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

Side by Side Diff: build/android/adb_install_apk.py

Issue 1222453003: Fix adb_install_apk, broken by 9b3e716. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Utility script to install APKs from the command line quickly.""" 7 """Utility script to install APKs from the command line quickly."""
8 8
9 import argparse 9 import argparse
10 import logging 10 import logging
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 devices = [d for d in devices if d == args.device] 68 devices = [d for d in devices if d == args.device]
69 if not devices: 69 if not devices:
70 raise device_errors.DeviceUnreachableError(args.device) 70 raise device_errors.DeviceUnreachableError(args.device)
71 elif not devices: 71 elif not devices:
72 raise device_errors.NoDevicesError() 72 raise device_errors.NoDevicesError()
73 73
74 def blacklisting_install(device): 74 def blacklisting_install(device):
75 try: 75 try:
76 device.Install(apk, reinstall=args.keep_data) 76 device.Install(apk, reinstall=args.keep_data)
77 except device_errors.CommandFailedError: 77 except device_errors.CommandFailedError:
78 logging.exception('Failed to install %s', args.apk) 78 logging.exception('Failed to install %s', args.apk_name)
79 device_blacklist.ExtendBlacklist([str(device)]) 79 device_blacklist.ExtendBlacklist([str(device)])
80 logging.warning('Blacklisting %s', str(device)) 80 logging.warning('Blacklisting %s', str(device))
81 except device_errors.CommandTimeoutError: 81 except device_errors.CommandTimeoutError:
82 logging.exception('Timed out while installing %s', args.apk) 82 logging.exception('Timed out while installing %s', args.apk_name)
83 device_blacklist.ExtendBlacklist([str(device)]) 83 device_blacklist.ExtendBlacklist([str(device)])
84 logging.warning('Blacklisting %s', str(device)) 84 logging.warning('Blacklisting %s', str(device))
85 85
86 device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_install) 86 device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_install)
87 87
88 88
89 if __name__ == '__main__': 89 if __name__ == '__main__':
90 sys.exit(main()) 90 sys.exit(main())
91 91
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698