Skip to content

Instantly share code, notes, and snippets.

@a2
Last active September 25, 2018 12:11
Show Gist options
  • Save a2/9bc24b2d93a3307ed64434ddf118045c to your computer and use it in GitHub Desktop.
Save a2/9bc24b2d93a3307ed64434ddf118045c to your computer and use it in GitHub Desktop.
Installs app at argument path to all booted simulators and launches them
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "$0 <path>"
exit 1
fi
APP_PATH=$1
BUNDLE_ID=`/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$APP_PATH/Info.plist"`
for DEVICE in $(xcrun simctl list -j devices | jq --raw-output ".devices[][] | select(.state == \"Booted\") | .udid"); do
xcrun simctl install $DEVICE $APP_PATH && xcrun simctl launch $DEVICE $BUNDLE_ID >/dev/null &
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment