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

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: 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..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)])
« 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