Skip to content

Instantly share code, notes, and snippets.

@oguzhanvarsak
Last active August 15, 2023 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oguzhanvarsak/f70ed597c833926df7c664e1a39bb86f to your computer and use it in GitHub Desktop.
Save oguzhanvarsak/f70ed597c833926df7c664e1a39bb86f to your computer and use it in GitHub Desktop.
Install the App to Simulator Using xcodebuild
# This script creates the .app file from the project,
# saves it into a path,
# runs the simulator
# and installs the app.
#!/bin/bash
xcodebuild -workspace <workspace name>.xcworkspace \
-scheme <scheme name> \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 14,OS=16.4' \
clean build install DSTROOT=./App # `DSTROOT=` sets the path of generated .app file.
xcrun simctl boot "iPhone 14" # Boot the simulator
xcrun simctl install booted ./App/Applications/<app name>.app # Install the App file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment