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

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
plastiv committed Mar 6, 2019
1 parent a37d899 commit f167f4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions android-emulator/start-emulator.sh
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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
4 changes: 2 additions & 2 deletions android-emulator/wait-for-boot-completed
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f167f4f

Please sign in to comment.