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

Unified Diff: build/android/adb_install_apk.py

Issue 11365004: Android: makes "apk_package" optional in adb_install_apk.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 8 years, 2 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/pylib/apk_info.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 355b9635ef1ca67b6e8a25ca4a367defd6ea6858..49b796a6ca53f55df713672ad147f3354f712670 100755
--- a/build/android/adb_install_apk.py
+++ b/build/android/adb_install_apk.py
@@ -10,17 +10,15 @@ import os
import sys
from pylib import android_commands
+from pylib import apk_info
from pylib import test_options_parser
from pylib import constants
frankf 2012/10/31 18:04:26 Move this up so it's alphabetical.
bulach 2012/10/31 18:44:20 Done.
-def InstallApk(args):
- options, device = args
- apk_path = os.path.join(os.environ['CHROME_SRC'],
- 'out', options.build_type,
- 'apks', options.apk)
+def _InstallApk(args):
+ apk_path, apk_package, device = args
result = android_commands.AndroidCommands(device=device).ManagedInstall(
- apk_path, False, options.apk_package)
+ apk_path, False, apk_package)
print '----- Installed on %s -----' % device
print result
@@ -38,9 +36,19 @@ def main(argv):
if not devices:
raise Exception('Error: no connected devices')
+ apk_path = os.path.join(os.environ['CHROME_SRC'],
+ 'out', options.build_type,
+ 'apks', options.apk)
frankf 2012/10/31 18:04:26 optional: Maybe move this to function similar to V
bulach 2012/10/31 18:44:20 good idea! done..
+
+ apk_package = options.apk_package
+ if not apk_package:
+ apk_package = apk_info.GetPackageNameForApk(apk_path)
+
pool = multiprocessing.Pool(len(devices))
- # Send a tuple (options, device) per instance of DeploySingleDevice.
- pool.map(InstallApk, zip([options] * len(devices), devices))
+ # Send a tuple (apk_path, apk_package, device) per device.
+ pool.map(_InstallApk, zip([apk_path] * len(devices),
+ [apk_package] * len(devices),
+ devices))
if __name__ == '__main__':
« no previous file with comments | « no previous file | build/android/pylib/apk_info.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698