-
-
Save anonymous/614aafb2d8710865c688684a8657a141 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set +e | |
bootanim="" | |
failcounter=0 | |
timeout_in_sec=500 | |
until [[ "$bootanim" =~ "stopped" ]]; do | |
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &` | |
echo "$bootanim" | |
if [[ "$bootanim" =~ "not found" | |
|| "$bootanim" =~ "device not found" | |
|| "$bootanim" =~ "no emulators found" | |
|| "$bootanim" =~ "device offline" | |
|| "$bootanim" =~ "running" ]]; then | |
let "failcounter += 5" | |
echo "Waiting for emulator to start" | |
if [[ $failcounter -gt timeout_in_sec ]]; then | |
echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator" | |
jobs -l | |
exit 1 | |
fi | |
fi | |
sleep 5 | |
done | |
echo "Emulator is ready!" | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for ((PORT=5554; PORT<=5584; PORT+=2)); do | |
echo killing emulator-$PORT... | |
adb -s emulator-$PORT emu kill || true | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment