Skip to content

Commit 73b803e

Browse files
committed
misc: wait for device readyness in the exec wrapper
Updates #23824 Change-Id: I5472a05eb2cf571ccc84c76c6f592bf4dd2e3cb4 Reviewed-on: https://go-review.googlesource.com/c/163621 Run-TryBot: Elias Naur <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent f5aecc1 commit 73b803e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

misc/android/go_android_exec.go

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ func main() {
5959
log.SetFlags(0)
6060
log.SetPrefix("go_android_exec: ")
6161

62+
// In case we're booting a device or emulator alongside androidtest.bash
63+
// wait for it to be ready. adb wait-for-device is not enough, we have to
64+
// wait for sys.boot_completed.
65+
run("wait-for-device", "shell", "while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;")
66+
6267
// Prepare a temporary directory that will be cleaned up at the end.
6368
deviceGotmp := fmt.Sprintf("/data/local/tmp/%s-%d",
6469
filepath.Base(os.Args[1]), os.Getpid())

0 commit comments

Comments
 (0)