diff --git a/wait_for_emulator b/wait_for_emulator new file mode 100644 index 0000000..207f028 --- /dev/null +++ b/wait_for_emulator @@ -0,0 +1,17 @@ +#!/bin/bash + +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 3 ]]; then + echo "Failed to start emulator" + exit 1 + fi + fi + sleep 1 +done +echo "Done" \ No newline at end of file