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

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

Issue 167643002: android: Don't require aapt to be on the path during builds and tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rietfail Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | build/android/gyp/apk_install.py » ('j') | build/android/gyp/apk_install.py » ('J')
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 multiprocessing 9 import multiprocessing
10 import optparse 10 import optparse
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 constants.SetBuildType(options.build_type) 56 constants.SetBuildType(options.build_type)
57 ValidateInstallAPKOption(parser, options) 57 ValidateInstallAPKOption(parser, options)
58 if len(args) > 1: 58 if len(args) > 1:
59 raise Exception('Error: Unknown argument:', args[1:]) 59 raise Exception('Error: Unknown argument:', args[1:])
60 60
61 devices = android_commands.GetAttachedDevices() 61 devices = android_commands.GetAttachedDevices()
62 if not devices: 62 if not devices:
63 raise Exception('Error: no connected devices') 63 raise Exception('Error: no connected devices')
64 64
65 if not options.apk_package: 65 if not options.apk_package:
66 options.apk_package = apk_helper.GetPackageName(options.apk) 66 options.apk_package = apk_helper.GetPackageName(constants.ANDROID_SDK_TOOLS,
67 options.apk)
67 68
68 pool = multiprocessing.Pool(len(devices)) 69 pool = multiprocessing.Pool(len(devices))
69 # Send a tuple (apk_path, apk_package, device) per device. 70 # Send a tuple (apk_path, apk_package, device) per device.
70 pool.map(_InstallApk, zip([options.apk] * len(devices), 71 pool.map(_InstallApk, zip([options.apk] * len(devices),
71 [options.apk_package] * len(devices), 72 [options.apk_package] * len(devices),
72 [options.keep_data] * len(devices), 73 [options.keep_data] * len(devices),
73 devices)) 74 devices))
74 75
75 76
76 if __name__ == '__main__': 77 if __name__ == '__main__':
77 sys.exit(main(sys.argv)) 78 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | build/android/gyp/apk_install.py » ('j') | build/android/gyp/apk_install.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698