Skip to content

Instantly share code, notes, and snippets.

@paulz
Created May 9, 2016 05:12
Show Gist options
  • Save paulz/7cac11ad9a2229c6920c7c2004e0a2fc to your computer and use it in GitHub Desktop.
Save paulz/7cac11ad9a2229c6920c7c2004e0a2fc to your computer and use it in GitHub Desktop.
#!/bin/bash -l
brew install ios-sim
brew link ios-sim
DEVICE_TYPE_ID="com.apple.CoreSimulator.SimDeviceType.iPhone-6s, 9.3"
available=$(ios-sim showdevicetypes | grep "$DEVICE_TYPE_ID" -c)
if (( available >= 1 ))
then
dir=`mktemp -d` && pushd $dir
unzip "$(dirname "$0")"/My.app.zip &>/dev/null
ios-sim launch ./My.app --devicetypeid "$DEVICE_TYPE_ID"
popd
else
echo "Could not find $DEVICE_TYPE_ID within the output of: ios-sim showdevicetypes"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment