Skip to content

Instantly share code, notes, and snippets.

@rbsilva
Created October 18, 2016 17:39
Show Gist options
  • Save rbsilva/67ab57ef8fb11f6210560d34e2c494a0 to your computer and use it in GitHub Desktop.
Save rbsilva/67ab57ef8fb11f6210560d34e2c494a0 to your computer and use it in GitHub Desktop.
android-wait-for-emulator.sh
#!/bin/bash
# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain
set +e
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 15 ]]; then
echo "Failed to start emulator"
exit 1
fi
fi
sleep 1
done
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment