Unverified Commit 431c599b authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Revert "[flutter_tools] If run fails to install the application on iOS, try...

Revert "[flutter_tools] If run fails to install the application on iOS, try uninstalling it and trying again. (#68078)" (#68118)

This reverts commit 61ba7dd2.
parent 61ba7dd2
......@@ -268,33 +268,6 @@ class IOSDevice extends Device {
_logger.printError(e.message);
return false;
}
if (installationResult == 0) {
return true;
}
_logger.printTrace('application failed to install: $installationResult');
// If the initial installation fails, attempt to uninstall the app if
// it was already installed. Regardless of whether or not this is successful,
// try once more to install.
if (await isAppInstalled(app, userIdentifier: userIdentifier)) {
_logger.printTrace('Uninstalling previously installed application...');
if (!await uninstallApp(app, userIdentifier: userIdentifier)) {
_logger.printTrace('Failed to uninstall');
}
}
try {
installationResult = await _iosDeploy.installApp(
deviceId: id,
bundlePath: bundle.path,
launchArguments: <String>[],
interfaceType: interfaceType,
);
} on ProcessException catch (e) {
_logger.printError(e.message);
return false;
}
if (installationResult != 0) {
_logger.printError('Could not install ${bundle.path} on $id.');
_logger.printError('Try launching Xcode and selecting "Product > Run" to fix the problem:');
......
......@@ -252,61 +252,6 @@ void main() {
expect(wasAppInstalled, false);
});
testWithoutContext('IOSDevice.installApp retries installation if it fails once', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final IOSApp iosApp = PrebuiltIOSApp(
projectBundleId: 'app',
bundleDir: fileSystem.currentDirectory,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
iosDeployPath,
'--id',
'1234',
'--bundle',
'/',
'--no-wifi',
], environment: const <String, String>{
'PATH': '/usr/bin:null',
...kDyLdLibEntry,
}, exitCode: 1),
FakeCommand(command: <String>[
iosDeployPath,
'--id',
'1234',
'--exists',
'--timeout',
'10',
'--bundle_id',
'app',
]),
FakeCommand(command: <String>[
iosDeployPath,
'--id',
'1234',
'--uninstall_only',
'--bundle_id',
'app',
]),
FakeCommand(command: <String>[
iosDeployPath,
'--id',
'1234',
'--bundle',
'/',
'--no-wifi',
], environment: const <String, String>{
'PATH': '/usr/bin:null',
...kDyLdLibEntry,
}),
]);
final IOSDevice device = setUpIOSDevice(processManager: processManager, artifacts: artifacts);
final bool wasAppInstalled = await device.installApp(iosApp);
expect(wasAppInstalled, true);
expect(processManager.hasRemainingExpectations, false);
});
testWithoutContext('IOSDevice.uninstallApp catches ProcessException from ios-deploy', () async {
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app');
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
......
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