简体   繁体   中英

how to set default device in iOS simulator from command line

http://cl.ly/image/2K1H000s170l

Please refer to my screenshot. That's a manual way to set default device in iOS simulator. Can anyone tell me how to do that from command line? Many thanks!

I need that as part of my Jenkins project setup. Thanks a lot!

You can use xcrun to open your device

xcrun instruments -w "iPhone 6 (8.4 Simulator)"

If you want to know all devices installed

xcrun instruments -s

If you need to build and install some app use.

xcodebuild -sdk iphonesimulator8.4 -arch i386 install DSTROOT=~/YourApp
xcrun simctl install booted ~/YourApp/Applications/YourApp.app

You can choose the device that is booted when the simulator launches by passing it on the command line. See Xcode 6 - Launch simulator from command line

Yes as mentioned this is a duplicate.

But to answer your question,

You can use the instruments to launch the simulator of your choice. For Ex:

xcrun instruments -w "iPhone 6 (8.2 Simulator)"

"From the screen shot it seems like you are already on iOS 8. "

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM