1#!/usr/bin/env bash 2 3set +e 4 5bootanim="" 6connectionAttempts=0 7until [[ "$bootanim" =~ "stopped" ]]; do 8 bootanim=`${ANDROID_SDK_ROOT:-$ANDROID_HOME}/platform-tools/adb -e shell getprop init.svc.bootanim 2>&1` 9 echo " ☛ $bootanim" 10 if [[ "$bootanim" =~ "not found" ]]; then 11 let "connectionAttempts += 1" 12 if [[ $connectionAttempts -gt 15 ]]; then 13 echo " Failed to start emulator" 14 exit 1 15 fi 16 fi 17 sleep 1 18done 19 20echo " ✅ Emulator is ready" 21