summaryrefslogtreecommitdiffstats
path: root/build/android/adb_install_apk.py
diff options
context:
space:
mode:
Diffstat (limited to 'build/android/adb_install_apk.py')
-rwxr-xr-xbuild/android/adb_install_apk.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/build/android/adb_install_apk.py b/build/android/adb_install_apk.py
index 50faea7..3000b81 100755
--- a/build/android/adb_install_apk.py
+++ b/build/android/adb_install_apk.py
@@ -53,6 +53,7 @@ def main():
'Default is env var BUILDTYPE or Debug.')
parser.add_argument('-d', '--device', dest='device',
help='Target device for apk to install on.')
+ parser.add_argument('--blacklist-file', help='Device blacklist JSON file.')
parser.add_argument('-v', '--verbose', action='count',
help='Enable verbose logging.')
@@ -82,7 +83,13 @@ def main():
and helper.GetSplitName()):
splits.append(f)
- devices = device_utils.DeviceUtils.HealthyDevices()
+ if args.blacklist_file:
+ blacklist = device_blacklist.Blacklist(args.blacklist_file)
+ else:
+ # TODO(jbudorick): Remove this once the bots are converted.
+ blacklist = device_blacklist.Blacklist(device_blacklist.BLACKLIST_JSON)
+
+ devices = device_utils.DeviceUtils.HealthyDevices(blacklist)
if args.device:
devices = [d for d in devices if d == args.device]
@@ -99,12 +106,14 @@ def main():
device.Install(apk, reinstall=args.keep_data)
except device_errors.CommandFailedError:
logging.exception('Failed to install %s', args.apk_name)
- device_blacklist.ExtendBlacklist([str(device)])
- logging.warning('Blacklisting %s', str(device))
+ if blacklist:
+ blacklist.Extend([str(device)])
+ logging.warning('Blacklisting %s', str(device))
except device_errors.CommandTimeoutError:
logging.exception('Timed out while installing %s', args.apk_name)
- device_blacklist.ExtendBlacklist([str(device)])
- logging.warning('Blacklisting %s', str(device))
+ if blacklist:
+ blacklist.Extend([str(device)])
+ logging.warning('Blacklisting %s', str(device))
device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_install)