diff options
author | Elias Naur <mail@eliasnaur.com> | 2019-02-24 16:46:23 +0100 |
---|---|---|
committer | Elias Naur <mail@eliasnaur.com> | 2019-02-24 21:54:41 +0000 |
commit | 73b803ee532173f64a5d3fb2cd0fbe789d49571e (patch) | |
tree | df0cffef02a1ed1d58d4aa6bb8a10e35812128f3 /misc/android | |
parent | f5aecc1d1dfab8ad3397915f13920825e2ce6701 (diff) | |
download | go-73b803ee532173f64a5d3fb2cd0fbe789d49571e.tar.gz go-73b803ee532173f64a5d3fb2cd0fbe789d49571e.zip |
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 <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'misc/android')
-rw-r--r-- | misc/android/go_android_exec.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/misc/android/go_android_exec.go b/misc/android/go_android_exec.go index 2376e29796..e36edacc76 100644 --- a/misc/android/go_android_exec.go +++ b/misc/android/go_android_exec.go @@ -59,6 +59,11 @@ func main() { log.SetFlags(0) log.SetPrefix("go_android_exec: ") + // In case we're booting a device or emulator alongside androidtest.bash + // wait for it to be ready. adb wait-for-device is not enough, we have to + // wait for sys.boot_completed. + run("wait-for-device", "shell", "while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;") + // Prepare a temporary directory that will be cleaned up at the end. deviceGotmp := fmt.Sprintf("/data/local/tmp/%s-%d", filepath.Base(os.Args[1]), os.Getpid()) |