scheme is not configured for the test action (iOS

2019-04-03 01:03发布

I am trying to run an Xcode unit test for my iOS application. I am willing to do it on an iPad connected via USB to a mac machine. I am trying to run the test from the command line in order to trigger it from Jenkins later on. Below is what I'm currently typing into the command line and the error I'm getting. Please help.

The code:

xcodebuild test -scheme MyApplication -destination "platform=iOS,name=iPad"

The error:

Scheme MyApplication is not currently configured for the test action

5条回答
该账号已被封号
2楼-- · 2019-04-03 01:21

My problem was that the Tests.swift file was importing a module that no longer existed (I renamed the Targets for the project). Check to make sure all test files are importing currently existing modules.

查看更多
霸刀☆藐视天下
3楼-- · 2019-04-03 01:26
  • You should check your workspace data on Jenkins and see which *.xctest is already uploaded. Then you have to rename your UI/Unit test target to that *.xctest data in your xcode project like what you have on Jenkins and then push again.
  • OR wipe out your workspace from Jenkins and push all data again with new UI/Unit test target again.

(Of course you have to ensure that you have already made a scheme for project.)

查看更多
Deceive 欺骗
4楼-- · 2019-04-03 01:33

For everyone struggling with this problem.

My solution was to:

  1. Select Test Target
  2. Manage Scheme
  3. Select Run in the left menu
  4. Select Info in the tab
  5. Choose Executable Target from the dropdown menu
  6. Hit Close.
查看更多
叛逆
5楼-- · 2019-04-03 01:36

For me the problem was that no tests were added to my scheme:

Scheme Editor

By adding test bundles to my scheme via the '+' button then the scheme could be built by Xcode and xcodebuild.

查看更多
唯我独甜
6楼-- · 2019-04-03 01:42

Fixed this up by removing duplicate schemes from Xcode. The schemes can be added/removed/shared/edited in Xcode via Product -> Scheme -> Manage Schemes.

查看更多
登录 后发表回答