There will be times where you want to do these on the command line.
List the available SDKs
For example, I have iphonesimulator8.2 in my list of SDKs. This will be used in the next step.
Build the project:
xcodebuild -project '/path/to/Awesome.xcproj' -arch i386 -sdk iphonesimulator8.2
If you are using workspace, then you need to provide the scheme too:
xcodebuild -workspace '/path/to/Awesome.xcworkspace' -scheme 'Awesome-Production' -arch i386 -sdk iphonesimulator8.2
Or, more likely, you are using Xcode app (not commandline), then just build the app as per normal.
The build will be created at ~/Library/Developer/Xcode/DerivedData.
So, if the build is successful, the app will be at ~/Library/Developer/Xcode/DerivedData/Awesome-dvxamtpiqakwogarovbwiagepzxj/Build/Products/Release-iphonesimulator/Awesome.app. This path is needed in the next step.
Run on Simulator
Use ios-sim to help run on simulator.
Install it with
brew install ios-sim.
# First, find the device type ios-sim showdevicetypes # Example using iPhone 6 Plus ios-sim launch --devicetypeid "iPhone-6-Plus, 9.2" /path/to/awesome.app