Tool: Provide guided migration logs when iOS app crashes due to missi…#188556
Tool: Provide guided migration logs when iOS app crashes due to missi…#188556okorohelijah wants to merge 3 commits into
Conversation
…ng UIScene lifecycle - Populate UserMessages.uiSceneMigrationWarning with a helpful migration guide. - Update devicectl _ignorePatterns in core_devices.dart to preserve UIScene crash logs. - Add uiscene_crash LogInterceptor to IOSDevice to catch the crash and throw a guided ToolExit. - Add unit tests verifying the log interception and exit behavior. Fixes flutter#187758
There was a problem hiding this comment.
Code Review
This pull request updates the iOS device logging and error handling to detect and handle UIScene lifecycle requirements. Specifically, it changes 'uiSceneMigrationWarning' to a non-nullable getter, adds a log interceptor to throw a 'ToolExit' when a UIScene crash log is detected, and updates the relevant tests. Feedback on these changes highlights a typo in the warning message referring to 'iOS 27' instead of 'iOS 18', and notes that the documentation comment for the public 'uiSceneMigrationWarning' getter was mistakenly removed.
There was a problem hiding this comment.
The message states that UIScene lifecycle is required on iOS 27, which is likely a typo for iOS 18. iOS 18 is the version where the UIScene lifecycle requirement was introduced by Apple.
| UIScene lifecycle is required on iOS 27 and later. | |
| UIScene lifecycle is required on iOS 18 and later. |
| /// Overridable message to be shown when detected from device logs that UIScene migration is | ||
| /// still required. | ||
| String? uiSceneMigrationWarning; | ||
| String get uiSceneMigrationWarning => ''' |
There was a problem hiding this comment.
The documentation comment for uiSceneMigrationWarning was removed. According to the Repository Style Guide, all public members should have documentation.
| String get uiSceneMigrationWarning => ''' | |
| /// Overridable message to be shown when detected from device logs that UIScene migration is | |
| /// still required. | |
| String get uiSceneMigrationWarning => ''' |
References
- All public members should have documentation. (link)
|
Proposed future improvement in #188557 |
| @@ -344,7 +344,7 @@ class IOSCoreDeviceControl { | |||
| // * Don't ignore flutter logs: | |||
| // 2025-09-16 12:50:07.953318-0500 Runner[1279:149305] flutter: ... | |||
| RegExp( | |||
| r'^\S* \S* \S*\[[0-9:]*] ((?!(\[INFO|\[WARNING|\[ERROR|\[IMPORTANT|\[FATAL):))(?!(flutter:))(?!(\[UIKit App Config\] `UIScene` lifecycle)).*', | |||
| r'^\S* \S* \S*\[[0-9:]*] ((?!(\[INFO|\[WARNING|\[ERROR|\[IMPORTANT|\[FATAL):))(?!(flutter:))(?!(\[UIKit App Config\] `UIScene` lifecycle))(?!.*UIScene life\s?cycle).*', | |||
There was a problem hiding this comment.
Don't use this variable for your error. This is for internal usage.

When an unmigrated iOS app runs on iOS 27+, it immediately crashes on launch because the
UIScenelifecycle is required.List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.
Fixes #187758
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).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. Comments from the
gemini-code-assistbot 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.