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

Unified Diff: build/android/adb_install_apk.py

Issue 1200543002: [Android] Add support for installing split apks with adb_install_apk. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Automatically find splits based on base apk name. Created 5 years, 6 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 | no next file » | 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 1e370f8fa8ea4c765a5bb003b94a666473c9d08b..1fb47e98c71c90332d32bba11050922210a12844 100755
--- a/build/android/adb_install_apk.py
+++ b/build/android/adb_install_apk.py
@@ -7,6 +7,7 @@
"""Utility script to install APKs from the command line quickly."""
import argparse
+import glob
import logging
import os
import sys
@@ -17,7 +18,6 @@ from pylib.device import device_errors
from pylib.device import device_utils
from pylib.utils import run_tests_helper
-
def main():
parser = argparse.ArgumentParser()
@@ -30,6 +30,10 @@ def main():
# TODO(jbudorick): Remove once no clients pass --apk_package
parser.add_argument('--apk_package', help='DEPRECATED unused')
+ parser.add_argument('--split',
+ action='store_true',
+ default=False,
+ help='Indicates you are installing a split apk.')
parser.add_argument('--keep_data',
action='store_true',
default=False,
@@ -64,6 +68,12 @@ def main():
devices = device_utils.DeviceUtils.HealthyDevices()
+ if args.split:
+ apk_without_extension = apk[:-len('.apk')]
+ density_splits = glob.glob(apk_without_extension + '-density-*.apk')
jbudorick 2015/06/25 00:36:53 This is too automagical. agrieve provided an examp
mikecase (-- gone --) 2015/06/26 18:59:33 Changed it so that users pass in the globs that ma
+ abi_splits = glob.glob(apk_without_extension + '-abi-*.apk')
+ language_splits = glob.glob(apk_without_extension + '-lang-*.apk')
+
if args.device:
devices = [d for d in devices if d == args.device]
if not devices:
@@ -73,7 +83,12 @@ def main():
def blacklisting_install(device):
try:
- device.Install(apk, reinstall=args.keep_data)
+ if args.split:
+ device.InstallSplitApk(
+ apk, density_splits + abi_splits + language_splits,
+ reinstall=args.keep_data)
+ else:
+ device.Install(apk, reinstall=args.keep_data)
except device_errors.CommandFailedError:
logging.exception('Failed to install %s', args.apk)
device_blacklist.ExtendBlacklist([str(device)])
« 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