Skip to content

Instantly share code, notes, and snippets.

@viperwarp
Created January 5, 2015 04:16
Show Gist options
  • Save viperwarp/3cfc572a77f784c255a5 to your computer and use it in GitHub Desktop.
Save viperwarp/3cfc572a77f784c255a5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain
# Edited for log brevity by Affian <https://github.com/viperwarp>
set +e
bootanim=""
failcounter=0
echo "Waiting for Emulator"
until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1`
echo -ne "."
if [[ "$bootanim" =~ "not found" ]]; then
let "failcounter += 1"
if [[ $failcounter -gt 15 ]]; then
echo "Failed to start emulator"
exit 1
fi
fi
sleep 2
done
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment