Reputation: 25526
After upgrade to Xcode 7, Xcode cannot run tests on simulator.
$ xcodebuild test -sdk iphonesimulator -scheme MyProject
Build settings from command line:
SDKROOT = iphonesimulator9.0
xcodebuild: error: Failed to build project MyProject with scheme MyProject.
Reason: Xcode cannot run using the selected device.
The issue is reproduced on Travis CI and Jenkins. It's worked fine when I run xcodebuild test
on a local machine.
Upvotes: 1
Views: 561
Reputation: 2834
I've gotten past this error by adding a flag like -destination 'name=iPhone 6'
. It seems like xcodebuild used to pick a default destination but isn't doing that anymore. =|
I'm going to see if there is anything I can set in the build scheme to avoid hard coding a device.
Upvotes: 3