Created
October 18, 2016 17:39
-
-
Save rbsilva/67ab57ef8fb11f6210560d34e2c494a0 to your computer and use it in GitHub Desktop.
android-wait-for-emulator.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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