huangcm
2025-04-09 4696e2bde39d1780d2f64566b149f32011b4f9f4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
echo "Waiting for emulator to start..."
 
bootanim=""
failcounter=0
until [[ "$bootanim" =~ "stopped" ]]; do
   bootanim=`adb -e shell getprop init.svc.bootanim 2>&1`
   let "failcounter += 1"
   # Timeout after 5 minutes.
   if [[ $failcounter -gt 300 ]]; then
      echo "Can not find device after 5 minutes..."
      exit 1
   fi
   sleep 1
done