Add an option to pick a different adb binary.

This will let the recipes use the copy pulled from Chromium's android_tools.

BUG=26

Change-Id: Ica6519223b9fb6daef30f3e14c72ef6422de0f6c
Reviewed-on: https://boringssl-review.googlesource.com/7982
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2016-05-19 00:13:22 -04:00 committed by Adam Langley
parent 5693e42ae4
commit 00b1069a6b

View File

@ -28,6 +28,7 @@ import (
var ( var (
buildDir = flag.String("build-dir", "build", "Specifies the build directory to push.") buildDir = flag.String("build-dir", "build", "Specifies the build directory to push.")
adbPath = flag.String("adb", "adb", "Specifies the adb binary to use. Defaults to looking in PATH.")
device = flag.String("device", "", "Specifies the device or emulator. See adb's -s argument.") device = flag.String("device", "", "Specifies the device or emulator. See adb's -s argument.")
aarch64 = flag.Bool("aarch64", false, "Build the test runners for aarch64 instead of arm.") aarch64 = flag.Bool("aarch64", false, "Build the test runners for aarch64 instead of arm.")
arm = flag.Int("arm", 7, "Which arm revision to build for.") arm = flag.Int("arm", 7, "Which arm revision to build for.")
@ -49,7 +50,7 @@ func adb(args ...string) error {
if len(*device) > 0 { if len(*device) > 0 {
args = append([]string{"-s", *device}, args...) args = append([]string{"-s", *device}, args...)
} }
cmd := exec.Command("adb", args...) cmd := exec.Command(*adbPath, args...)
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
return cmd.Run() return cmd.Run()