From e83e427eb17f9ea3cbeda472241bca1dbb0d7568 Mon Sep 17 00:00:00 2001 From: Quentin Monnier Date: Wed, 18 Jan 2023 17:57:38 +0000 Subject: [PATCH] Update wait-for-android-emulator --- .gitlab-ci-files/wait-for-android-emulator | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci-files/wait-for-android-emulator b/.gitlab-ci-files/wait-for-android-emulator index 98c037492..690647004 100755 --- a/.gitlab-ci-files/wait-for-android-emulator +++ b/.gitlab-ci-files/wait-for-android-emulator @@ -9,7 +9,7 @@ adb="${ANDROID_HOME}/platform-tools/adb" device="emulator-5554" timeout_in_sec=360 -while getopts a:t:d flag; do +while getopts a:d:t flag; do case "${flag}" in a) adb=${OPTARG};; d) device=${OPTARG};; @@ -19,11 +19,11 @@ done until [[ "$bootanim" =~ "stopped" ]]; do bootanim=`$adb -s $device -e shell getprop init.svc.bootanim 2>&1 &` - if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline" + if [[ "$bootanim" =~ "device '$device' not found" || "$bootanim" =~ "device '$device' offline" || "$bootanim" =~ "running" ]]; then let "failcounter += 1" if [[ $failcounter = 1 ]]; then - echo -n "Waiting for emulator to start"; else + echo -n "Waiting for $device to start"; else echo -n "." fi if [[ $failcounter -gt timeout_in_sec ]]; then @@ -34,4 +34,4 @@ until [[ "$bootanim" =~ "stopped" ]]; do sleep 1 done -echo "Emulator is ready" +echo "$device is ready"