From 919e85ae056a238789af6bb2d7b34fe9fdde4ebb Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 20 Jan 2018 19:56:51 +0100 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Hyang-Ah Hana Kim --- misc/android/go_android_exec.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'misc/android') 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) -- cgit v1.3-5-g9baa