Xcode project scheme is not currently configured for the test action
IosXcodeUnit TestingCommand LineIos Problem Overview
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. 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
Ios Solutions
Solution 1 - Ios
For me the problem was that no tests were added to my scheme:
By adding test bundles to my scheme via the '+' button then the scheme could be built by Xcode and xcodebuild.
Solution 2 - Ios
For everyone struggling with this problem.
My solution was to:
- Select Test Target
- Manage Scheme
- Select Run in the left menu
- Select Info in the tab
- Choose Executable Target from the dropdown menu
- Hit Close.
Solution 3 - Ios
Fixed this up by removing duplicate schemes from Xcode. The schemes can be added/removed/shared/edited in Xcode via Product -> Scheme -> Manage Schemes.
Solution 4 - Ios
Please follow following steps to resolve this error.
- Select your project scheme at the top.
- Click on Manage Schemes.
- Select your test target in the popup.
- Make sure to click on Edit button at the bottom left of popup.
- Select Build.
- Click the checkbox below "Run"
- Close the popup.
Solution 5 - Ios
- 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.)
Solution 6 - Ios
In my case I had no test file...
Here is a tutorial to perform UI Tests and create screenshots :
https://krausefx.com/blog/run-xcode-7-ui-tests-from-the-command-line
Solution 7 - Ios
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.
Solution 8 - Ios
I was getting this similar error, but none of the other solutions helped. Since the error was first noticed while running via Fastlane, I next ran xcodebuild manually using this command to mimic the same.
xcodebuild -workspace Noname.xcworkspace -scheme Noname -enableCodeCoverage YES build-for-testing
I then saw errors regarding: Signing for "Noname-Dependency" requires a development team.
I also so reference to a macosx signing error, which I cannot sadly reproduce having since fixed the issue.
To fix the issue, under Signing & Capabilities for the Target I selected None and then under General I unchecked Mac, as we are not needing/using that but it was selected by default when creating this new project (CocoaPod).
Oddly enough, I added back Mac and things still kept working. I think that there is a oddity with the Xcode project file and/or scheme file(s) such that when you tinker enough with it -- things get reset/fixed.
Solution 9 - Ios
I had a test plan set up (xctestplan).
- I needed a separate configuration for the tests (the test plan) in addition to "Shared Settings".
- Please also make sure that the test plan (under Xcode scheme settings) includes a test target AND a configuration.
Screenshots attached:
Solution 10 - Ios
Your test plan should have at least one custom configuration.
Solution 11 - Ios
- Go to Manage Schemes.
- Delete all schemes and click on Autocreate Schemes.