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

Unified Diff: build/android/devil/android/sdk/adb_wrapper.py

Issue 1511473004: [Android] Add support for installing older versions of installed apks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adb_install_apk changes and rebase Created 5 years 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 | « build/android/devil/android/device_utils_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil/android/sdk/adb_wrapper.py
diff --git a/build/android/devil/android/sdk/adb_wrapper.py b/build/android/devil/android/sdk/adb_wrapper.py
index b254a7525bba9fc4395f8e909a68006d8b4fd712..42e55ad5bfaaf31001177f74ac14f4504f65d366 100644
--- a/build/android/devil/android/sdk/adb_wrapper.py
+++ b/build/android/devil/android/sdk/adb_wrapper.py
@@ -464,13 +464,15 @@ class AdbWrapper(object):
return [a.strip() for a in
self._RunDeviceAdbCmd(['jdwp'], timeout, retries).split('\n')]
- def Install(self, apk_path, forward_lock=False, reinstall=False,
- sd_card=False, timeout=60*2, retries=_DEFAULT_RETRIES):
+ def Install(self, apk_path, forward_lock=False, allow_downgrade=False,
+ reinstall=False, sd_card=False, timeout=60*2,
+ retries=_DEFAULT_RETRIES):
"""Install an apk on the device.
Args:
apk_path: Host path to the APK file.
forward_lock: (optional) If set forward-locks the app.
+ allow_downgrade: (optional) If set, allows for downgrades.
reinstall: (optional) If set reinstalls the app, keeping its data.
sd_card: (optional) If set installs on the SD card.
timeout: (optional) Timeout per try in seconds.
@@ -484,6 +486,8 @@ class AdbWrapper(object):
cmd.append('-r')
if sd_card:
cmd.append('-s')
+ if allow_downgrade:
+ cmd.append('-d')
cmd.append(apk_path)
output = self._RunDeviceAdbCmd(cmd, timeout, retries)
if 'Success' not in output:
@@ -500,10 +504,10 @@ class AdbWrapper(object):
forward_lock: (optional) If set forward-locks the app.
reinstall: (optional) If set reinstalls the app, keeping its data.
sd_card: (optional) If set installs on the SD card.
- timeout: (optional) Timeout per try in seconds.
- retries: (optional) Number of retries to attempt.
allow_downgrade: (optional) Allow versionCode downgrade.
partial: (optional) Package ID if apk_paths doesn't include all .apks.
+ timeout: (optional) Timeout per try in seconds.
+ retries: (optional) Number of retries to attempt.
"""
for path in apk_paths:
VerifyLocalFileExists(path)
« no previous file with comments | « build/android/devil/android/device_utils_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698