Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Switch to dev.bootcomplete property
Browse files Browse the repository at this point in the history
  • Loading branch information
plastiv committed Mar 6, 2019
1 parent f167f4f commit db29c9f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions android-emulator/wait-for-boot-completed
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
set -euo pipefail
IFS=$'\n\t'

# Fetch sys.boot_completed instead of init.svc.bootanim to allow -no-boot-anim option.
# Fetch dev.bootcomplete instead of init.svc.bootanim to allow -no-boot-anim option.
# Follow what AndroidStudio is using https://android.googlesource.com/platform/tools/adt/idea/+/studio-master-dev/android/src/com/android/tools/idea/avdmanager/EmulatorConnectionListener.java#142
adb wait-for-device
boot_completed=`adb -e shell getprop sys.boot_completed 2>&1 | head -n 1`
boot_completed=`adb -e shell getprop dev.bootcomplete 2>&1 | head -n 1`
timeout=0
until [ "${boot_completed:0:1}" = "1" ]; do
sleep 1
boot_completed=`adb -e shell getprop sys.boot_completed 2>&1 | head -n 1`
echo "Wait for 'shell getprop sys.boot_completed' ${timeout}/500"
boot_completed=`adb -e shell getprop dev.bootcomplete 2>&1 | head -n 1`
echo "Wait for 'shell getprop dev.bootcomplete' ${timeout}/500"
let "timeout += 1"
if [ $timeout -gt 500 ]; then
echo "Failed to start emulator (timeout)"
Expand Down

0 comments on commit db29c9f

Please sign in to comment.