From 74c614c8f2b55e48652368790dc1aa0f2d750c7f Mon Sep 17 00:00:00 2001 From: "nduca@chromium.org" Date: Tue, 29 Jan 2013 02:43:39 +0000 Subject: [PATCH] Add --keep_data as option to adb_install_apk Useful in a compile/debug/retry workflow where you're wanting to keep some options persisted across installs. Defaults to off so it doesn't mess anything in production. R=craigdh@chromium.org Review URL: https://chromiumcodereview.appspot.com/12096018 git-svn-id: http://src.chromium.org/svn/trunk/src/build@179275 4ff67af0-8c30-449e-8e8b-ad334ec8d88c --- android/adb_install_apk.py | 5 +++-- android/pylib/utils/test_options_parser.py | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/android/adb_install_apk.py b/android/adb_install_apk.py index 7601a3fc6..8728c0899 100755 --- a/android/adb_install_apk.py +++ b/android/adb_install_apk.py @@ -16,9 +16,9 @@ from pylib.utils import test_options_parser def _InstallApk(args): - apk_path, apk_package, device = args + apk_path, apk_package, keep_data, device = args result = android_commands.AndroidCommands(device=device).ManagedInstall( - apk_path, False, apk_package) + apk_path, keep_data, apk_package) print '----- Installed on %s -----' % device print result @@ -42,6 +42,7 @@ def main(argv): # Send a tuple (apk_path, apk_package, device) per device. pool.map(_InstallApk, zip([options.apk] * len(devices), [options.apk_package] * len(devices), + [options.keep_data] * len(devices), devices)) diff --git a/android/pylib/utils/test_options_parser.py b/android/pylib/utils/test_options_parser.py index d716cb871..5dee755c8 100644 --- a/android/pylib/utils/test_options_parser.py +++ b/android/pylib/utils/test_options_parser.py @@ -37,6 +37,11 @@ def AddInstallAPKOption(option_parser): option_parser.add_option('--apk_package', help=('The package name used by the apk containing ' 'the application.')) + option_parser.add_option('--keep_data', + action='store_true', + default=False, + help=('Keep the package data when installing ' + 'the application.')) def ValidateInstallAPKOption(option_parser, options):