mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-19 04:21:17 +00:00
AndroidWorkload: Uninstall uiauto apks before reinstalling
Due to the fact that uiauto apk files built on different machines will be signed with different keys, adb will fail to overwrite a previous version even when set to replace. This commit now will uninstall the previous uiauto apk file if present before attempting to install the new version.
This commit is contained in:
parent
1168c1ada8
commit
9f3ecd3715
@ -99,7 +99,9 @@ class UiAutomatorWorkload(Workload):
|
||||
for k, v in self.uiauto_params.iter_encoded_items():
|
||||
params += ' -e {} "{}"'.format(k, v)
|
||||
|
||||
self.device.install_apk(self.uiauto_file, replace=True)
|
||||
if self.device.package_is_installed(self.uiauto_package):
|
||||
self.device.uninstall(self.uiauto_package)
|
||||
self.device.install_apk(self.uiauto_file)
|
||||
|
||||
instrumention_string = 'am instrument -w -r {} -e class {}.{} {}/{}'
|
||||
self.command = instrumention_string.format(params, self.uiauto_package,
|
||||
|
Loading…
x
Reference in New Issue
Block a user