Skip to content

Instantly share code, notes, and snippets.

@puppybits
Created December 21, 2011 16:52
Show Gist options
  • Save puppybits/1506746 to your computer and use it in GitHub Desktop.
Save puppybits/1506746 to your computer and use it in GitHub Desktop.
iOS automation CLI
#Example: itest /Volumes/MyApp/src/tests/automation.js MyAppName
function itest(){
MOBILE_SAFARI="/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Applications/MobileSafari.app";
JS_AUTOMATION_SCRIPT=$1;
APP_NAME=$2;
TEMPLATE_DIR="/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate";
APP_DIR=$(find ~/Library/Application\ Support/iPhone\ Simulator -iname $APP_NAME.app)
if [ !$APP_DIR ]
then
APP_DIR=$MOBILE_SAFARI;
fi
instruments -t \"$TEMPLATE_DIR\" \"$APP_DIR\" -e UIASCRIPT $JS_AUTOMATION_SCRIPT
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment