diff --git a/android-emulator/start-emulator.sh b/android-emulator/start-emulator.sh index f861944..831379a 100755 --- a/android-emulator/start-emulator.sh +++ b/android-emulator/start-emulator.sh @@ -1,14 +1,9 @@ #!/bin/bash -which sdkmanager -which avdmanager -which emulator -which adb -ldd `which emulator` java -Xmx32m -version sdkmanager --list -emulator -list-avds -emulator-check accel hyper-v cpu-info +avdmanager list avd +emulator-check accel hyper-v cpu-info window-mgr desktop-env # https://developer.android.com/studio/run/emulator-commandline#startup-options emulator -verbose -avd android-emulator-${EMULATOR_API_LEVEL} \ -no-accel \ @@ -22,7 +17,7 @@ emulator -verbose -avd android-emulator-${EMULATOR_API_LEVEL} \ -memory 2048 \ -skin 480x800 & ./wait-for-boot-completed -adb devices +adb devices -l adb shell pm dump com.google.android.gms | grep version -sleep 1 +sleep 2 adb emu kill diff --git a/android-emulator/wait-for-boot-completed b/android-emulator/wait-for-boot-completed index 787b8fb..2ba9303 100755 --- a/android-emulator/wait-for-boot-completed +++ b/android-emulator/wait-for-boot-completed @@ -7,12 +7,12 @@ IFS=$'\n\t' adb wait-for-device boot_completed=`adb -e shell getprop sys.boot_completed 2>&1 | head -n 1` timeout=0 -until [[ "X${boot_completed:0:1}" = "X1" ]]; do +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" let "timeout += 1" - if [[ $timeout -gt 500 ]]; then + if [ $timeout -gt 500 ]; then echo "Failed to start emulator (timeout)" exit 1 fi