diff options
| author | Elias Naur <mail@eliasnaur.com> | 2019-02-22 18:35:58 +0100 |
|---|---|---|
| committer | Elias Naur <mail@eliasnaur.com> | 2019-02-22 19:30:43 +0000 |
| commit | 27b9571de800c05a41081ea80cd934e48e0a8f70 (patch) | |
| tree | 5ac37aede9d251701b50bd2ee928eed964357eaa /src/androidtest.bash | |
| parent | 8ea27e117fffbb14ef3605a641444b79e9bd6c9e (diff) | |
| download | go-27b9571de800c05a41081ea80cd934e48e0a8f70.tar.xz | |
androidtest.bash: wait for device to be ready before using it
Updates #23824
Change-Id: I265e3f40192a0a4bf54f608d9408ba0cfef2b69c
Reviewed-on: https://go-review.googlesource.com/c/163457
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/androidtest.bash')
| -rwxr-xr-x | src/androidtest.bash | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/androidtest.bash b/src/androidtest.bash index e43b89c0dc..a3784bc454 100755 --- a/src/androidtest.bash +++ b/src/androidtest.bash @@ -69,6 +69,12 @@ cp -a "${GOROOT}/test" "${FAKE_GOROOT}/" cp -a "${GOROOT}/lib" "${FAKE_GOROOT}/" cp -a "${pkgdir}" "${FAKE_GOROOT}/pkg/" +# 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 +# wait for sys.boot_completed. +echo '# Waiting for android device to be ready' +adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;' + echo '# Syncing test files to android device' adb $GOANDROID_ADB_FLAGS shell mkdir -p /data/local/tmp/goroot time adb $GOANDROID_ADB_FLAGS sync data &> /dev/null |
