]> Cypherpunks repositories - gostls13.git/commitdiff
misc: wait for device readyness in the exec wrapper
authorElias Naur <mail@eliasnaur.com>
Sun, 24 Feb 2019 15:46:23 +0000 (16:46 +0100)
committerElias Naur <mail@eliasnaur.com>
Sun, 24 Feb 2019 21:54:41 +0000 (21:54 +0000)
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>
misc/android/go_android_exec.go

index 2376e29796a7fd358bf880ea85d4b3863f1a4fdb..e36edacc76b9386edcba2b5277b267a95f874c92 100644 (file)
@@ -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())