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..7e7a135134b33a7bd6c1c61fd0f2601fb855a43c 100755 |
| --- a/build/android/adb_install_apk.py |
| +++ b/build/android/adb_install_apk.py |
| @@ -30,6 +30,11 @@ def main(): |
| # TODO(jbudorick): Remove once no clients pass --apk_package |
| parser.add_argument('--apk_package', help='DEPRECATED unused') |
| + parser.add_argument('--apk-split', |
|
jbudorick
2015/06/24 19:00:39
Using this as-is looks like this:
./build/andro
mikecase (-- gone --)
2015/06/24 19:16:19
Almost. Using this as is looks like this...
./bui
|
| + dest='apk_splits', |
| + action='append', |
| + help='An apk split. Can be specified multiple times. ' |
| + 'Used for installing a split apk.') |
| parser.add_argument('--keep_data', |
| action='store_true', |
| default=False, |
| @@ -54,13 +59,21 @@ def main(): |
| run_tests_helper.SetLogLevel(args.verbose) |
| constants.SetBuildType(args.build_type) |
| - apk = args.apk_path or args.apk_name |
| - if not apk.endswith('.apk'): |
| - apk += '.apk' |
| - if not os.path.exists(apk): |
| - apk = os.path.join(constants.GetOutDirectory(), 'apks', apk) |
| + def resolve_apk_path(apk): |
| + if not apk.endswith('.apk'): |
| + apk += '.apk' |
| if not os.path.exists(apk): |
| - parser.error('%s not found.' % apk) |
| + apk = os.path.join(constants.GetOutDirectory(), 'apks', apk) |
| + if not os.path.exists(apk): |
| + parser.error('%s not found.' % apk) |
| + return apk |
| + |
| + apk = args.apk_path or args.apk_name |
| + apk = resolve_apk_path(apk) |
| + |
| + if args.apk_splits: |
| + for i, apk_split in enumerate(args.apk_splits): |
| + args.apk_splits[i] = resolve_apk_path(apk_split) |
| devices = device_utils.DeviceUtils.HealthyDevices() |
| @@ -73,7 +86,10 @@ def main(): |
| def blacklisting_install(device): |
| try: |
| - device.Install(apk, reinstall=args.keep_data) |
| + if args.apk_splits: |
| + device.InstallSplitApk(apk, args.apk_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)]) |