Skip to content

Instantly share code, notes, and snippets.

@DavidFrahm
Created January 27, 2015 19:42
Show Gist options
  • Save DavidFrahm/3d70aecf698ae6e3f350 to your computer and use it in GitHub Desktop.
Save DavidFrahm/3d70aecf698ae6e3f350 to your computer and use it in GitHub Desktop.
Ionic app build and choose iOS Simulator
#!/bin/bash
echo "Building Ionic/Cordova iOS release..."
ionic build --release ios
export DEVICES=`ios-sim showdevicetypes 2>&1`
export DEVICES=\"`echo $DEVICES | sed -e 's/ com./" "com./g' | sed -e 's/, /,~/g'`\"
PS3='Please enter your choice: '
options=($DEVICES)
app="`find ./platforms/ios/build/emulator/ -name *.app -print`"
escaped_app="\"$app\""
echo $app
select opt in "${options[@]}"
do
case $opt in
*) echo ios-sim launch "$escaped_app" --devicetypeid "`echo $opt | sed -e "s/~/ /g"`" --stderr ./platforms/ios/cordova/console.log --stdout ./platforms/ios/cordova/console.log > ~emulate-ios.tmp;chmod +x ~emulate-ios.tmp;./~emulate-ios.tmp;rm ~emulate-ios.tmp;exit;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment