aboutsummaryrefslogtreecommitdiff
path: root/misc/android
diff options
context:
space:
mode:
authorElias Naur <elias.naur@gmail.com>2018-01-20 19:56:51 +0100
committerElias Naur <elias.naur@gmail.com>2018-01-20 21:13:30 +0000
commit919e85ae056a238789af6bb2d7b34fe9fdde4ebb (patch)
tree6cf0adb52c28e6e4cfa8ff89ee1b803e54141dd4 /misc/android
parent3810f5bfed72d401b5b78b6b1e281d671c599606 (diff)
downloadgo-919e85ae056a238789af6bb2d7b34fe9fdde4ebb.tar.gz
go-919e85ae056a238789af6bb2d7b34fe9fdde4ebb.zip
misc,src: add support for specifying adb flags to the android harness
Introduce GOANDROID_ADB_FLAGS for additional flags to adb invocations. With GOANDROID_ADG_FLAGS, the Android builders can distinguish between emulator and device builds. Change-Id: I11729926a523ee27f6a3795cb2cfb64a9454f0a5 Reviewed-on: https://go-review.googlesource.com/88795 Run-TryBot: Elias Naur <elias.naur@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Diffstat (limited to 'misc/android')
-rw-r--r--misc/android/go_android_exec.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/misc/android/go_android_exec.go b/misc/android/go_android_exec.go
index 49b7ae902c..5671479d87 100644
--- a/misc/android/go_android_exec.go
+++ b/misc/android/go_android_exec.go
@@ -21,6 +21,9 @@ import (
)
func run(args ...string) string {
+ if flags := os.Getenv("GOANDROID_ADB_FLAGS"); flags != "" {
+ args = append(strings.Split(flags, " "), args...)
+ }
buf := new(bytes.Buffer)
cmd := exec.Command("adb", args...)
cmd.Stdout = io.MultiWriter(os.Stdout, buf)