Wednesday 25 February 2015

Importent command to Make Simulator build & Control simulator

1. SDKs versions are available by running the following command in the terminal:
xcodebuild -showsdks

2. Build the Simulator Package
xcodebuild -arch i386 -sdk iphonesimulator{version}
e.g. xcodebuild -arch x86_64 -sdk iphonesimulator8.1 for xcode 6.2

3 . To Lauch simulator From Command
open -a "iOS Simulator" --args -CurrentDeviceUDID <DEVICE UDID>

4. where you can figure out the UDID of the device you want to boot from:
xcrun simctl list

5.  Apple has introduced an interesting tool with Xcode 6!
simctl

6.  simclt allows you to control the simulators running run xcrun simctl to get the list of available subcommands. Lots of new options to play around.

7. Now to do what I wanted. Here is the command to launch simulator
xcrun instruments -w "iPhone 5 (8.0 Simulator)"
 -w is to provide device type and to get the list of available devices, just execute this
xcrun instruments -s

8. After launching the simulator you can control it using simctl
 To install your app
 xcrun simctl install booted <app path>

9. To launch the app

xcrun simctl launch booted <app identifier>





No comments: