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

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: 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
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 3ab7ddc096a9dad266c15a48df30e2ced45ed4d4..5a1e4027e608f4746d235cc5d9e9074024d908f9 100644
--- a/build/android/devil/android/sdk/adb_wrapper.py
+++ b/build/android/devil/android/sdk/adb_wrapper.py
@@ -438,8 +438,9 @@ 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:
@@ -449,6 +450,7 @@ class AdbWrapper(object):
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) If set, allows for downgrades.
jbudorick 2015/12/08 16:44:56 nit: same
rnephew (Reviews Here) 2015/12/08 16:57:57 Done.
"""
VerifyLocalFileExists(apk_path)
cmd = ['install']
@@ -458,6 +460,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:

Powered by Google App Engine
This is Rietveld 408576698