Skip to content

Instantly share code, notes, and snippets.

@eagletmt
Created July 11, 2012 20:02
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 eagletmt/3092913 to your computer and use it in GitHub Desktop.
Save eagletmt/3092913 to your computer and use it in GitHub Desktop.
#!/bin/bash
AVD="$1"
if [ -z "$AVD" ]; then
echo "usage: $0 <avd name>"
exit 1
fi
emulator-arm -avd "$AVD" -no-window &
ant clean debug
echo 'Waiting for device...'
adb wait-for-device
for _ in `seq 30`
do
# send MENU key to unlock the screen
# http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_MENU
R=$(adb shell input keyevent 82)
if [ -z "$R" ]; then
break
fi
echo "input returned: $R"
sleep 1
done
ant installd test
kill %1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment