Skip to content

Commit 50a6484

Browse files
committed
Updated ci-wait-for-emulator.sh to restart adb if root fails
1 parent b1fbe04 commit 50a6484

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

script/ci-wait-for-emulator.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,21 @@ adb shell settings put global animator_duration_scale 0
2121
# To test WKD we need to route all traffic for localhost:443 to localhost:1212
2222
# as we can't use 443 directly for a mock web server.
2323
###################################################################################################
24-
adb root
24+
25+
adb root || {
26+
echo "adb root failed, restarting adb and waiting for emulator..."
27+
28+
adb kill-server || true
29+
adb start-server
30+
31+
adb wait-for-device
32+
33+
# shellcheck disable=SC2016
34+
adb shell 'while [[ "$(getprop sys.boot_completed)" != "1" ]]; do sleep 1; done;'
35+
}
36+
37+
sleep 2
38+
2539
adb wait-for-device
2640
# shellcheck disable=SC2016
2741
adb shell 'while [[ "$(getprop sys.boot_completed)" != "1" ]]; do sleep 1; done;'

0 commit comments

Comments
 (0)