Skip to content

Add structured warning event for slow wireless debugging on iOS 26+ devices - #176235

Closed
okorohelijah wants to merge 150 commits into
flutter:masterfrom
okorohelijah:fix_176206
Closed

okorohelijah wants to merge 150 commits into
flutter:masterfrom
okorohelijah:fix_176206

Conversation

@okorohelijah

Copy link
Copy Markdown
Contributor

This PR improves the developer experience when running or debugging Flutter apps on iOS 26+ devices connected via WiFi. The tool now emits a structured app.warning event (in addition to a console warning) when it detects wireless debugging on iOS 26 or later. This allows IDEs and other tools using --machine mode to display a prominent warning to users, encouraging them to use a wired (USB) connection for better performance.

Details

  • Detects when an iOS device is:
    • Running iOS 26 or later,
    • Connected wirelessly,
    • Debugging is enabled.
  • Emits a human-readable warning to the console.
  • Emits a structured app.warning event with relevant metadata (category, deviceId, iosVersion, suggestion, etc.) for IDEs and tools using --machine mode.
  • No changes to existing workflows for users not matching these conditions.

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 #176206

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.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. 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.

@okorohelijah
okorohelijah requested a review from a team as a code owner September 29, 2025 21:21
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions Bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. team-ios Owned by iOS platform team labels Sep 29, 2025
@okorohelijah
okorohelijah requested review from DanTup and vashworth and removed request for DanTup September 29, 2025 21:22

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a helpful warning for developers using wireless debugging on iOS 26+ devices, which can have performance issues. The implementation correctly identifies the conditions and emits both a console warning and a structured event for IDEs. My feedback includes a suggestion to replace the magic number 26 with a named constant to improve code readability and maintainability.

Comment thread packages/flutter_tools/lib/src/ios/devices.dart Outdated
Comment thread packages/flutter_tools/lib/src/ios/devices.dart Outdated
@okorohelijah
okorohelijah requested a review from DanTup October 1, 2025 22:04

@DanTup DanTup left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added some minor comments/nits, but otherwise lgtm - thanks! 🙂

This is sent when a warning is issued for a running application that an editor may wish to handle specifically. The `params` field will be a map with the following fields:

- `warning`: A string containing the warning message to be displayed to the user.
- `category`: A string used to categorize the warning (for example, `ios-wireless-performance`).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What might an editor do with this string?

I was thinking it might be useful for the editor to use if they want to show a "Don't warn me again" prompt and then store this as something to skip showing in future. However, for this I think a unique identifier per-message would be better (and the name category doesn't make it clear if this is unique).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

having an id for a specific warning which the IDE can ignore based on users' choice and category which could include different warningIds make sense!

Comment thread packages/flutter_tools/doc/daemon.md Outdated
- `warning`: A string containing the warning message to be displayed to the user.
- `category`: A string used to categorize the warning (for example, `ios-wireless-performance`).
- `deviceId`: The ID of the device this warning is relevant to.
- `iosVersion`: The iOS versionn of the device

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Although the current warning is for iOS, presumably in future we might use this for something else - so should we change this to something more generic (deviceOsVersion?) or just drop it? I'm not sure how useful it is to a client that's using this event generically.

(also nit: missing full stop at the end that the other points have)

@okorohelijah okorohelijah Oct 2, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think using deviceOsVersion is better than removing because it gives the IDE more flexibility to provide a structured data. and in a scenario where lets say the warning is more critical in some versions than some others, then the ide could maybe display a red icon instead of yellow to show severity

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

in a scenario where lets say the warning is more critical in some versions than some others, then the ide could maybe display a red icon instead of yellow to show severity

I don't think the IDE should need to know about these versions though - if we want something to be higher priority, it should be encoded into the JSON so it can be handled generically (eg. a severity field).

I don't see any downside to having the OS version too though - if nothing else it could be useful when reviewing logs if this warning is being reported.

Comment thread packages/flutter_tools/doc/daemon.md Outdated
Comment thread packages/flutter_tools/lib/src/ios/devices.dart Outdated
@DanTup
DanTup self-requested a review October 2, 2025 09:26
Comment thread packages/flutter_tools/lib/src/ios/devices.dart Outdated
@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems c: contributor-productivity Team-specific productivity, code health, technical debt. platform-android Android applications specifically framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. p: material_ui material_ui package in flutter/packages a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: internationalization Supporting other languages or locales. (aka i18n) platform-fuchsia Fuchsia code specifically p: cupertino_ui cupertino_ui package in flutter/packages platform-windows Building on or for Windows specifically d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos platform-web Web applications specifically platform-linux Building on or for Linux specifically a: desktop Running on desktop f: integration_test The flutter/packages/integration_test plugin e: impeller Impeller rendering backend issues and features requests team-android Owned by Android platform team team-engine Owned by Engine team d: docs/ flutter/flutter/docs, for contributors platform-macos labels Oct 7, 2025
@okorohelijah
okorohelijah deleted the fix_176206 branch October 7, 2025 21:01
@stuartmorgan-g stuartmorgan-g added platform-macos Building on or for macOS specifically and removed platform-macos labels Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: desktop Running on desktop a: internationalization Supporting other languages or locales. (aka i18n) a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems c: contributor-productivity Team-specific productivity, code health, technical debt. d: api docs Issues with https://api.flutter.dev/ d: docs/ flutter/flutter/docs, for contributors d: examples Sample code and demos e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels. f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. p: cupertino_ui cupertino_ui package in flutter/packages p: material_ui material_ui package in flutter/packages platform-android Android applications specifically platform-fuchsia Fuchsia code specifically platform-ios iOS applications specifically platform-linux Building on or for Linux specifically platform-macos Building on or for macOS specifically platform-web Web applications specifically platform-windows Building on or for Windows specifically team-android Owned by Android platform team team-engine Owned by Engine team team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wish for the flutter tool to help the user switch to USB instead of WiFi when running/debugging against iOS 26