From 531c86b6e93412d24a3e53c2b9495c88567d6084 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Wed, 26 Oct 2022 10:08:53 -0700 Subject: [PATCH] Revert part of "Terminate simulator app on "q" (#113581)" --- .../hot_mode_dev_cycle_ios_simulator.dart | 2 +- .../flutter_tools/lib/src/ios/simulators.dart | 22 ++----------------- .../general.shard/ios/simulators_test.dart | 18 --------------- 3 files changed, 3 insertions(+), 39 deletions(-) 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 d41e414f6240b..d8f178fa386c8 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 @@ Future main() async { 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 4cdb2c18a3d7a..f789f5a02ea27 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -257,25 +257,6 @@ class SimControl { return result; } - Future stopApp(String deviceId, String appIdentifier) async { - RunResult result; - try { - result = await _processUtils.run( - [ - ..._xcode.xcrunCommand(), - 'simctl', - 'terminate', - deviceId, - appIdentifier, - ], - throwOnError: true, - ); - } on ProcessException catch (exception) { - throwToolExit('Unable to terminate $appIdentifier on $deviceId:\n$exception'); - } - return result; - } - Future takeScreenshot(String deviceId, String outputPath) async { try { await _processUtils.run( @@ -555,7 +536,8 @@ class IOSSimulator extends Device { 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 ab58347ad3f22..45f42816d8b59 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 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' throwsToolExit(message: r'Unable to launch'), ); }); - - testWithoutContext('.stopApp() handles exceptions', () async { - fakeProcessManager.addCommand(const FakeCommand( - command: [ - 'xcrun', - 'simctl', - 'terminate', - deviceId, - appId, - ], - exception: ProcessException('xcrun', []), - )); - - expect( - () async => simControl.stopApp(deviceId, appId), - throwsToolExit(message: r'Unable to terminate'), - ); - }); }); group('startApp', () {