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

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

Issue 422883002: gdb : importing gdb webkit path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed checking sequence of attached device list & device option Created 6 years, 4 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 optparse 9 import optparse
10 import os 10 import os
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if len(args) > 1 and options.apk: 66 if len(args) > 1 and options.apk:
67 parser.error("Appending the apk as argument can't be used with --apk.") 67 parser.error("Appending the apk as argument can't be used with --apk.")
68 elif len(args) > 2: 68 elif len(args) > 2:
69 parser.error("Too many arguments.") 69 parser.error("Too many arguments.")
70 70
71 constants.SetBuildType(options.build_type) 71 constants.SetBuildType(options.build_type)
72 ValidateInstallAPKOption(parser, options, args) 72 ValidateInstallAPKOption(parser, options, args)
73 73
74 devices = android_commands.GetAttachedDevices() 74 devices = android_commands.GetAttachedDevices()
75 75
76 if not devices:
77 raise Exception('Error: no connected devices')
78
76 if options.device: 79 if options.device:
77 if options.device not in devices: 80 if options.device not in devices:
78 raise Exception('Error: %s not in attached devices %s' % (options.device, 81 raise Exception('Error: %s not in attached devices %s' % (options.device,
79 ','.join(devices))) 82 ','.join(devices)))
80 devices = [options.device] 83 devices = [options.device]
81 84
82 if not devices:
83 raise Exception('Error: no connected devices')
84
85 device_utils.DeviceUtils.parallel(devices).Install( 85 device_utils.DeviceUtils.parallel(devices).Install(
86 options.apk, reinstall=options.keep_data) 86 options.apk, reinstall=options.keep_data)
87 87
88 88
89 if __name__ == '__main__': 89 if __name__ == '__main__':
90 sys.exit(main(sys.argv)) 90 sys.exit(main(sys.argv))
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