aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/push_to_android.py
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-01-12 10:48:19 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-12 16:30:17 +0000
commita005acc036f8772cb6537b71d366825653888636 (patch)
tree9f371d1dc462648fbe55014753f25582b7f04d4f /gn/push_to_android.py
parent78f20e0e97472c39377bcb610d845ae6ef5d6ace (diff)
skia_android_serial = "auto"
Handy if you only have one device plugged in at a time. Note that when used, this makes GN treat all devices' serial numbers as "auto", so it won't re-push if you swap devices until you change the binary that's being pushed. Change-Id: I1f72133d6d8c4b5569734f191d414088e0b41f06 Reviewed-on: https://skia-review.googlesource.com/6948 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Derek Sollenberger <djsollen@google.com>
Diffstat (limited to 'gn/push_to_android.py')
-rwxr-xr-xgn/push_to_android.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gn/push_to_android.py b/gn/push_to_android.py
index b9ab36fa52..694439bf5a 100755
--- a/gn/push_to_android.py
+++ b/gn/push_to_android.py
@@ -12,9 +12,11 @@ import sys
host, serial, stamp = sys.argv[1:]
device = '/data/local/tmp/' + os.path.basename(host)
+restrict = [] if serial == 'auto' else ['-s', serial]
+
# adb push is verbose, so eat its output with check_output().
-subprocess.check_output(['adb', '-s', serial, 'push', host, device])
-subprocess.check_call(['adb', '-s', serial, 'shell', 'chmod', '+x', device])
+subprocess.check_output(['adb'] + restrict + ['push', host, device])
+subprocess.check_call(['adb'] + restrict + ['shell', 'chmod', '+x', device])
# Touch a file to let GN/Ninja know we succeeded.
with open(stamp, 'w'):