Chromium Code Reviews| 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)]) |