Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Unified Diff: build/android/adb_install_apk.py

Issue 1132993004: [Android] Remove more references to and uses of AndroidCommands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/adb_reverse_forwarder.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/adb_install_apk.py
diff --git a/build/android/adb_install_apk.py b/build/android/adb_install_apk.py
index 7bc634c7deb0188d412e0e7c188bfdaa0afeffd0..00bd38e1821d7957efcc5ffbd0dc9bc027f6fd09 100755
--- a/build/android/adb_install_apk.py
+++ b/build/android/adb_install_apk.py
@@ -11,6 +11,7 @@ import os
import sys
from pylib import constants
+from pylib.device import device_errors
from pylib.device import device_utils
@@ -73,14 +74,11 @@ def main(argv):
devices = device_utils.DeviceUtils.HealthyDevices()
if options.device:
- device_serials = [d.adb.GetDeviceSerial() for d in devices]
- if options.device not in device_serials:
- raise Exception('Error: %s not in attached devices %s' % (options.device,
- ','.join(device_serials)))
- devices = [options.device]
-
- if not devices:
- raise Exception('Error: no connected devices')
+ devices = [d for d in devices if d == options.device]
+ if not devices:
+ raise device_errors.DeviceUnreachableError(options.device)
+ elif not devices:
+ raise device_errors.NoDevicesError()
device_utils.DeviceUtils.parallel(devices).Install(
options.apk, reinstall=options.keep_data)
« no previous file with comments | « no previous file | build/android/adb_reverse_forwarder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698