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

Unified Diff: build/android/pylib/device/adb_wrapper.py

Issue 1134353002: Add --split-apk-path flag to apk_install.py, and install-multiple logic to adb_wrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix indentation Created 5 years, 7 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 | « build/android/gyp/apk_install.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/adb_wrapper.py
diff --git a/build/android/pylib/device/adb_wrapper.py b/build/android/pylib/device/adb_wrapper.py
index 8e8abf8b5e01bcc7d9bdbc911b3f4e7a634e2758..f88eab35be2b1710fa6f0c74e4b32e1240c9f26f 100644
--- a/build/android/pylib/device/adb_wrapper.py
+++ b/build/android/pylib/device/adb_wrapper.py
@@ -415,6 +415,40 @@ class AdbWrapper(object):
raise device_errors.AdbCommandFailedError(
cmd, output, device_serial=self._device_serial)
+ def InstallMultiple(self, apk_paths, forward_lock=False, reinstall=False,
+ sd_card=False, allow_downgrade=False, partial=False,
+ timeout=60*2, retries=_DEFAULT_RETRIES):
+ """Install an apk with splits on the device.
+
+ Args:
+ apk_paths: Host path to the APK file.
+ 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.
+ """
+ for path in apk_paths:
+ _VerifyLocalFileExists(path)
+ cmd = ['install-multiple']
+ if forward_lock:
+ cmd.append('-l')
+ if reinstall:
+ cmd.append('-r')
+ if sd_card:
+ cmd.append('-s')
+ if allow_downgrade:
+ cmd.append('-d')
+ if partial:
+ cmd.extend(('-p', partial))
+ cmd.extend(apk_paths)
+ output = self._RunDeviceAdbCmd(cmd, timeout, retries)
+ if 'Success' not in output:
+ raise device_errors.AdbCommandFailedError(
+ cmd, output, device_serial=self._device_serial)
+
def Uninstall(self, package, keep_data=False, timeout=_DEFAULT_TIMEOUT,
retries=_DEFAULT_RETRIES):
"""Remove the app |package| from the device.
@@ -570,4 +604,3 @@ class AdbWrapper(object):
return self.GetState() == _READY_STATE
except device_errors.CommandFailedError:
return False
-
« no previous file with comments | « build/android/gyp/apk_install.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698