summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authoryang.gu@intel.com <yang.gu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 18:08:25 +0000
committeryang.gu@intel.com <yang.gu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 18:08:25 +0000
commitb3ca3883b2a142ae535ea9b93391333f46efd8ab (patch)
treec905a1ddf55d2ab87b2572c914f4ddc2f23ced87 /build
parentcd122274f11d622f6a04221dd9d0af18e1cba42b (diff)
downloadchromium_src-b3ca3883b2a142ae535ea9b93391333f46efd8ab.zip
chromium_src-b3ca3883b2a142ae535ea9b93391333f46efd8ab.tar.gz
chromium_src-b3ca3883b2a142ae535ea9b93391333f46efd8ab.tar.bz2
Add option device in install apk script
Sometimes we need to designate device to install apk on, so this option is needed. BUG= Review URL: https://codereview.chromium.org/321403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/adb_install_apk.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/build/android/adb_install_apk.py b/build/android/adb_install_apk.py
index ea39aea..5d0fd17 100755
--- a/build/android/adb_install_apk.py
+++ b/build/android/adb_install_apk.py
@@ -37,6 +37,8 @@ def AddInstallAPKOption(option_parser):
dest='build_type',
help='If set, run test suites under out/Release. '
'Default is env var BUILDTYPE or Debug.')
+ option_parser.add_option('-d', '--device', dest='device',
+ help='Target device for apk to install on.')
def ValidateInstallAPKOption(option_parser, options, args):
@@ -70,6 +72,13 @@ def main(argv):
ValidateInstallAPKOption(parser, options, args)
devices = android_commands.GetAttachedDevices()
+
+ if options.device:
+ if options.device not in devices:
+ raise Exception('Error: %s not in attached devices %s' % (options.device,
+ ','.join(devices)))
+ devices = [options.device]
+
if not devices:
raise Exception('Error: no connected devices')