1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

Android Device: Add force flag to install_apk

A force flag has been added to the `install_apk` method which
ignores the check that the specified file is an apk. This is to support
the new UiAutomation Apk which have been given the extention .uiautoapk.
This commit is contained in:
Marc Bonnici 2017-05-05 10:54:49 +01:00
parent e038fb924a
commit 5d8305cfdc

View File

@ -390,10 +390,10 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
else:
return self.install_executable(filepath, with_name)
def install_apk(self, filepath, timeout=default_timeout, replace=False, allow_downgrade=False): # pylint: disable=W0221
def install_apk(self, filepath, timeout=default_timeout, replace=False, allow_downgrade=False, force=False): # pylint: disable=W0221
self._check_ready()
ext = os.path.splitext(filepath)[1].lower()
if ext == '.apk':
if ext == '.apk' or force:
flags = []
if replace:
flags.append('-r') # Replace existing APK