Unverified Commit 6268c04b authored by Camille Simon's avatar Camille Simon Committed by GitHub

[Android] Modify Linux_android flutter_engine_group_performance to uninstall...

[Android] Modify Linux_android flutter_engine_group_performance to uninstall app before attempting to install (#127429)

Changes `Linux_android flutter_engine_group_performance` to uninstall the app that it uses for testing before attempting to install it again to ensure proper cleanup.

Attempt at fixing https://github.com/flutter/flutter/issues/127011.
parent b4796915
......@@ -20,6 +20,13 @@ Future<void> _withApkInstall(
final DeviceDiscovery devices = DeviceDiscovery();
final AndroidDevice device = await devices.workingDevice as AndroidDevice;
await device.unlock();
try {
// Force proper cleanup before trying to install app. If uninstall fails,
// we log exception and proceed with running the test.
await device.adb(<String>['uninstall', bundleName]);
} on Exception catch (error) {
print('adb uninstall failed with exception: $error. Will proceed with test run.');
}
await device.adb(<String>['install', '-r', apkPath]);
try {
await body(device);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment