react-native-navigation的迁移库

waitForAndroidEmulator.sh 546B

12345678910111213141516171819202122
  1. #!/bin/bash -e
  2. bootanim=""
  3. failcounter=0
  4. timeout_in_sec=360
  5. until [[ "$bootanim" =~ "stopped" ]]; do
  6. bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &`
  7. if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline"
  8. || "$bootanim" =~ "running" ]]; then
  9. let "failcounter += 1"
  10. echo "Waiting for emulator to start"
  11. if [[ $failcounter -gt timeout_in_sec ]]; then
  12. echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
  13. exit 1
  14. fi
  15. fi
  16. sleep 1
  17. done
  18. echo "Emulator is ready"