Skip to content

Instantly share code, notes, and snippets.

@ligi
Last active August 29, 2015 14:18
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 ligi/4bbfeddb28b36da3e8e9 to your computer and use it in GitHub Desktop.
Save ligi/4bbfeddb28b36da3e8e9 to your computer and use it in GitHub Desktop.
ci spoon script
#!/bin/bash
set +e
download-android
echo y | android update sdk --no-ui --filter android-18 > /dev/null
echo y | android update sdk --no-ui --filter sys-img-armeabi-v7a-android-18 --all > /dev/null
echo no | android create avd --force -n test -t android-18 --abi armeabi-v7a --skin 1280x800
emulator -avd test -no-skin -no-audio -no-window &
# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain
bootanim=""
failcounter=0
until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1`
echo "$bootanim"
if [[ "$bootanim" =~ "not found" ]]; then
let "failcounter += 1"
if [[ $failcounter -gt 42 ]]; then
echo "Failed to start emulator"
exit 1
fi
fi
sleep 1
done
echo "Emulator available"
adb shell input keyevent 82 &
./gradlew spoon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment