Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcodebuild does not launch iOS 7.0 simulator

I am trying to run our test suite with the iOS 7 simulator but xcodebuild always starts the 6.1 simulator.

xcodebuild -workspace Project.xcworkspace -scheme 'Test Smoke' -sdk iphonesimulator7.0 -destination="platform='iOS Simulator',OS=7.0,name='iPhone Retina (4-inch)’" clean test

It works if I deinstall the iOS 6.0 and 6.1 simulator but this is not an option.

like image 786
btype Avatar asked Jan 10 '14 09:01

btype


People also ask

How do you choose a simulated device as a destination?

Select a simulated device For iOS, tvOS, and watchOS apps, you can choose a simulated device, under [Platform] Simulators, from the run destination menu next to the scheme menu in the toolbar.

How do I start Xcode simulator from terminal?

Just type this command in Terminal: open -a Simulator. app to launch the most recent simulator. Type this command in Terminal to run the Simulator rigth from the its folder.


1 Answers

You’re almost there:

The -destination parameter is special, in that you cannot quote the part that comes after the “=” sign.

Meaning this:

xcodebuild \
    -workspace Project.xcworkspace \
    -scheme 'Test Smoke' \
    -sdk iphonesimulator7.0 \
    -destination platform='iOS Simulator',OS=7.0,name='iPhone Retina (4-inch)' \
    clean test

will work.

Note that the commas between the options within the -destination parameter must immediately be followed by the next option.

Also note that — if you specified a name that doesn’t match anything that actually exists — this command will just hang.

like image 150
danyowdee Avatar answered Oct 12 '22 17:10

danyowdee