Skip to content

Commit e8dca90

Browse files
authored
Terminate existing process before launching with devicectl (flutter#191885)
Speculative fix for flutter#190995. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 8fc4562 commit e8dca90

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎packages/flutter_tools/lib/src/ios/core_devices.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ class IOSCoreDeviceControl {
732732
'launch',
733733
'--device',
734734
deviceId,
735+
'--terminate-existing',
735736
if (startStopped) '--start-stopped',
736737
if (attachToConsole) ...<String>[
737738
'--console',

‎packages/flutter_tools/test/general.shard/ios/core_devices_test.dart‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,7 @@ invalid JSON
16841684
'launch',
16851685
'--device',
16861686
deviceId,
1687+
'--terminate-existing',
16871688
'--json-output',
16881689
tempFile.path,
16891690
bundleId,
@@ -1774,6 +1775,7 @@ invalid JSON
17741775
'launch',
17751776
'--device',
17761777
deviceId,
1778+
'--terminate-existing',
17771779
'--json-output',
17781780
tempFile.path,
17791781
bundleId,
@@ -1849,6 +1851,7 @@ invalid JSON
18491851
'launch',
18501852
'--device',
18511853
deviceId,
1854+
'--terminate-existing',
18521855
'--json-output',
18531856
tempFile.path,
18541857
bundleId,
@@ -1926,6 +1929,7 @@ ERROR: The operation couldn?t be completed. (OSStatus error -10814.) (NSOSStatus
19261929
'launch',
19271930
'--device',
19281931
deviceId,
1932+
'--terminate-existing',
19291933
'--json-output',
19301934
tempFile.path,
19311935
bundleId,
@@ -1967,6 +1971,7 @@ ERROR: The operation couldn?t be completed. (OSStatus error -10814.) (NSOSStatus
19671971
'launch',
19681972
'--device',
19691973
deviceId,
1974+
'--terminate-existing',
19701975
'--json-output',
19711976
tempFile.path,
19721977
bundleId,
@@ -2006,6 +2011,7 @@ invalid JSON
20062011
'launch',
20072012
'--device',
20082013
deviceId,
2014+
'--terminate-existing',
20092015
'--json-output',
20102016
tempFile.path,
20112017
bundleId,
@@ -2045,6 +2051,7 @@ invalid JSON
20452051
'launch',
20462052
'--device',
20472053
deviceId,
2054+
'--terminate-existing',
20482055
'--start-stopped',
20492056
'--console',
20502057
'--environment-variables',
@@ -2088,6 +2095,7 @@ Waiting for the application to terminate...
20882095
'launch',
20892096
'--device',
20902097
deviceId,
2098+
'--terminate-existing',
20912099
'--start-stopped',
20922100
'--console',
20932101
'--environment-variables',
@@ -2133,6 +2141,7 @@ Waiting for the application to terminate...
21332141
'launch',
21342142
'--device',
21352143
deviceId,
2144+
'--terminate-existing',
21362145
'--start-stopped',
21372146
'--console',
21382147
'--environment-variables',
@@ -2206,6 +2215,7 @@ Waiting for the application to terminate...
22062215
'launch',
22072216
'--device',
22082217
deviceId,
2218+
'--terminate-existing',
22092219
'--start-stopped',
22102220
'--console',
22112221
'--environment-variables',

0 commit comments

Comments
 (0)