wait_for_emulator.sh 430 B

12345678910111213141516171819
  1. #!/bin/bash
  2. bootanim=""
  3. failcounter=0
  4. checkcounter=0
  5. until [[ "$bootanim" =~ "stopped" ]]; do
  6. bootanim=`adb -e shell getprop init.svc.bootanim 2>&1`
  7. echo "($checkcounter) $bootanim"
  8. if [[ "$bootanim" =~ "not found" ]]; then
  9. let "failcounter += 1"
  10. if [[ $failcounter -gt 30 ]]; then
  11. echo "Failed to start emulator"
  12. exit 1
  13. fi
  14. fi
  15. let "checkcounter += 1"
  16. sleep 10
  17. done
  18. echo "Done"