Skip to content

Commit e8bd5a3

Browse files
authored
Delete simulator after plugin_test_ios (#136265)
Remove simulator once it's no longer needed for test `plugin_test_ios` . Fixes flutter/flutter#136224
1 parent 5064f78 commit e8bd5a3

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

dev/devicelab/lib/tasks/plugin_tests.dart

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -263,17 +263,23 @@ public class $pluginClass: NSObject, FlutterPlugin {
263263
throw TaskResult.failure('Platform unit tests failed');
264264
}
265265
case 'ios':
266-
await testWithNewIOSSimulator('TestNativeUnitTests', (String deviceId) async {
267-
if (!await runXcodeTests(
268-
platformDirectory: path.join(rootPath, 'ios'),
269-
destination: 'id=$deviceId',
270-
configuration: 'Debug',
271-
testName: 'native_plugin_unit_tests_ios',
272-
skipCodesign: true,
273-
)) {
274-
throw TaskResult.failure('Platform unit tests failed');
275-
}
276-
});
266+
String? simulatorDeviceId;
267+
try {
268+
await testWithNewIOSSimulator('TestNativeUnitTests', (String deviceId) async {
269+
simulatorDeviceId = deviceId;
270+
if (!await runXcodeTests(
271+
platformDirectory: path.join(rootPath, 'ios'),
272+
destination: 'id=$deviceId',
273+
configuration: 'Debug',
274+
testName: 'native_plugin_unit_tests_ios',
275+
skipCodesign: true,
276+
)) {
277+
throw TaskResult.failure('Platform unit tests failed');
278+
}
279+
});
280+
} finally {
281+
await removeIOSimulator(simulatorDeviceId);
282+
}
277283
case 'linux':
278284
if (await exec(
279285
path.join(rootPath, 'build', 'linux', 'x64', 'release', 'plugins', 'plugintest', 'plugintest_test'),

0 commit comments

Comments
 (0)