Revert part of "Terminate simulator app on "q" (#113581)" (#114083) (#114098)
Co-authored-by: Jenn Magder <magder@google.com>
diff --git a/dev/devicelab/bin/tasks/hot_mode_dev_cycle_ios_simulator.dart b/dev/devicelab/bin/tasks/hot_mode_dev_cycle_ios_simulator.dart
index d41e414..d8f178f 100644
--- a/dev/devicelab/bin/tasks/hot_mode_dev_cycle_ios_simulator.dart
+++ b/dev/devicelab/bin/tasks/hot_mode_dev_cycle_ios_simulator.dart
@@ -16,7 +16,7 @@
await testWithNewIOSSimulator('TestHotReloadSim', (String deviceId) async {
simulatorDeviceId = deviceId;
// This isn't actually a benchmark test, so do not use the returned `benchmarkScoreKeys` result.
- await createHotModeTest(deviceIdOverride: deviceId, checkAppRunningOnLocalDevice: true)();
+ await createHotModeTest(deviceIdOverride: deviceId)();
});
} finally {
await removeIOSimulator(simulatorDeviceId);
diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart
index 4cdb2c1..f789f5a 100644
--- a/packages/flutter_tools/lib/src/ios/simulators.dart
+++ b/packages/flutter_tools/lib/src/ios/simulators.dart
@@ -257,25 +257,6 @@
return result;
}
- Future<RunResult> stopApp(String deviceId, String appIdentifier) async {
- RunResult result;
- try {
- result = await _processUtils.run(
- <String>[
- ..._xcode.xcrunCommand(),
- 'simctl',
- 'terminate',
- deviceId,
- appIdentifier,
- ],
- throwOnError: true,
- );
- } on ProcessException catch (exception) {
- throwToolExit('Unable to terminate $appIdentifier on $deviceId:\n$exception');
- }
- return result;
- }
-
Future<void> takeScreenshot(String deviceId, String outputPath) async {
try {
await _processUtils.run(
@@ -555,7 +536,8 @@
ApplicationPackage app, {
String? userIdentifier,
}) async {
- return (await _simControl.stopApp(id, app.id)).exitCode == 0;
+ // Currently we don't have a way to stop an app running on iOS.
+ return false;
}
String get logFilePath {
diff --git a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart
index ab58347..45f4281 100644
--- a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart
+++ b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart
@@ -901,24 +901,6 @@
throwsToolExit(message: r'Unable to launch'),
);
});
-
- testWithoutContext('.stopApp() handles exceptions', () async {
- fakeProcessManager.addCommand(const FakeCommand(
- command: <String>[
- 'xcrun',
- 'simctl',
- 'terminate',
- deviceId,
- appId,
- ],
- exception: ProcessException('xcrun', <String>[]),
- ));
-
- expect(
- () async => simControl.stopApp(deviceId, appId),
- throwsToolExit(message: r'Unable to terminate'),
- );
- });
});
group('startApp', () {