Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Revert part of "Terminate simulator app on "q" (#113581)" #114083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Future<void> 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)();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated this test locally since it won't run in presubmit:

Task result:
{
  "success": true,
  "data": null,
  "detailFiles": [],
  "benchmarkScoreKeys": [],
  "reason": "success"
}

});
} finally {
await removeIOSimulator(simulatorDeviceId);
Expand Down
22 changes: 2 additions & 20 deletions packages/flutter_tools/lib/src/ios/simulators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,25 +257,6 @@ class SimControl {
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(
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: <String>[
'xcrun',
'simctl',
'terminate',
deviceId,
appId,
],
exception: ProcessException('xcrun', <String>[]),
));

expect(
() async => simControl.stopApp(deviceId, appId),
throwsToolExit(message: r'Unable to terminate'),
);
});
});

group('startApp', () {
Expand Down