Sitelet https://github.com/flutter/flutter/pull/188941
Skip to content

Suggest the -d flag after interactive device selection - #188941

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
theprantadutta:tools/device-id-hint-after-prompt
Sep 15, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
theprantadutta:tools/device-id-hint-after-prompt

Conversation

@theprantadutta

Copy link
Copy Markdown
Contributor

When flutter run (or any command that resolves a target device) finds multiple devices and no -d flag was given, it interactively prompts the user to pick one — but never tells them how to skip that prompt next time. This implements the suggestion from #63541 (and follows the pointer @jmagman gave there): after the user picks a device, print

To skip this prompt in the future, pass the device id to the "-d" flag, e.g. "-d macos".

with the id of the device they just chose.

The hint is printed in both selection flows:

  • TargetDevices._chooseOneOfAvailableDevices (the standard flow), right after the selection is parsed.
  • TargetDevicesWithExtendedWirelessDeviceDiscovery._selectFromDevicesAndCheckForWireless (the macOS + iOS wireless flow), after the chosen-device future completes rather than inside TargetDeviceSelection.userSelectDevice — printing it at selection time would interleave with (and get wiped by) the line-clearing/reprinting that happens when wireless device discovery finishes while the prompt is up.

The 17 existing interactive-selection tests that assert the full status text have been updated to include the hint line, and the eleventh-device test now asserts the hint contains the correct id (-d id-11) rather than the fake default.

Fixes #63541

Pre-launch Checklist

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 3, 2026
@bkonyi

bkonyi commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Hi @theprantadutta! Do you plan on coming back to this PR?

@bkonyi bkonyi added the waiting for response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 18, 2026
@theprantadutta

Copy link
Copy Markdown
Contributor Author

Yes, definitely — sorry for the silence on it. This has been sitting as a draft for one reason only: as a non-committer I can have at most two open non-draft PRs, and #188939 and #188940 currently hold both slots (both are mid-review). So it's parked rather than abandoned.

The work itself is finished and still healthy — I re-checked just now:

  • no merge conflicts against master
  • target_devices_test.dart passes 97/97, including the 17 expectations updated for the new hint

I'll flip it to ready the moment one of the other two lands. If you'd rather look at it sooner, say the word and I'll flip it straight away — happy to let one of the others go back to draft to free the slot if that's the preferred order.

@github-actions github-actions Bot removed the waiting for response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 22, 2026
@theprantadutta
theprantadutta marked this pull request as ready for review August 29, 2026 16:23
@theprantadutta

Copy link
Copy Markdown
Contributor Author

@bkonyi following up on your question from Aug 18 — a slot freed up when #188940 merged today, so this is now marked ready for review.

Nothing has changed since you asked: no merge conflicts, and target_devices_test.dart passes 97/97 including the 17 expectations updated for the new hint.

@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 hint message in TargetDevices and TargetDevicesWithExtendedWirelessDeviceDiscovery to inform users how to skip the device selection prompt in the future by using the "-d" flag with the chosen device's ID. The corresponding unit tests have been updated to assert the presence of this new message. I have no feedback to provide.

@bkonyi bkonyi added the CICD Run CI/CD label Aug 31, 2026
@bkonyi
bkonyi requested review from bkonyi and chingjun August 31, 2026 17:47

@bkonyi bkonyi 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.

LGTM!

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 1, 2026
@theprantadutta

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews @bkonyi @chingjun 🙏

Heads-up on why there's a new commit after your approvals: the ci.yaml validation check was failing. The cause wasn't the change itself — this branch was opened in early July and had drifted 187 commits behind, so it was still carrying an old .ci.yaml (master's has moved by roughly +941/-438 lines since). I merged master in (5940448) and .ci.yaml is now identical to master's, which should clear that check.

The PR diff is unchanged by the merge — still only the two files, and target_devices_test.dart passes 98/98 (one more than before; master added a case). Both of your approvals carried over to the new head.

One thing I can't do from my side: pushing dropped the CICD label, and I don't have permission to add labels back (403 Must have admin rights). Could someone re-apply CICD, and autosubmit once the checks are green?

@chingjun chingjun added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Sep 1, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 2, 2026
@auto-submit

auto-submit Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/188941, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@theprantadutta

Copy link
Copy Markdown
Contributor Author

The autosubmit label came off again on Sep 2 because Dashboard Checks failed. I dug into the actual build rather than assuming it was a flake, and I believe it is one — details so someone can decide quickly:

The only failing job is Linux web_skwasm_tests_0 (build 8671822780029516161). Buildbucket reports:

status        : INFRA_FAILURE
statusDetails : {"timeout": {}}
summary       : The build was cancelled: Step('run test.dart for web_skwasm_tests shard and subshard 0')
start / end   : 23:14:05Z → 23:59:16Z  (~45 min, then cancelled)

So it wasn't a test assertion — the shard ran to its timeout and was cancelled, which buildbucket classifies as infrastructure rather than failure. Its sibling shard Linux web_skwasm_tests_1 passed on the same commit, and every other check on this PR is green.

This PR only touches flutter_tools device selection (target_devices.dart and its test), which has no path to the web/skwasm renderer tests.

Could someone re-run that one job and re-apply autosubmit? I can't do either from here (403 Must have admin rights on labels). Both approvals are still active on the current head.

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 15, 2026
@bkonyi bkonyi added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Sep 15, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 15, 2026
@auto-submit

auto-submit Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/188941, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 15, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 15, 2026
Merged via the queue into flutter:master with commit b5e159f Sep 15, 2026
36 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 15, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 17, 2026
…12890)

Manual roll requested by stuartmorgan@google.com

flutter/flutter@27fec0e...8737f11

2026-09-15 bkonyi@google.com [flutter_tools] Migrate BuildBundleCommand to modular dependency injection (flutter/flutter#192462)
2026-09-15 dacoharkes@google.com Migrate SDK constraints for record_use and data_asset integration test packages to ^3.13.0-0 (flutter/flutter#192728)
2026-09-15 zhongliu88889@gmail.com [tool] Defer app.restart until the app has finished starting (flutter/flutter#192650)
2026-09-15 44747303+theprantadutta@users.noreply.github.com Suggest the -d flag after interactive device selection (flutter/flutter#188941)
2026-09-15 engine-flutter-autoroll@skia.org Roll Packages from 9caa77c to bebbb57 (9 revisions) (flutter/flutter#192809)
2026-09-15 evanwall@buffalo.edu Add a compiler warning for fragment shaders containing both texture samplers and early returns. (flutter/flutter#191969)
2026-09-15 kevmoo@users.noreply.github.com feat(flutter_tools): migrate Android build commands to typed options (flutter/flutter#192524)
2026-09-15 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 7R1l5MhSZZUr1Q6D1... to XCxrICzX1DWvyfqhA... (flutter/flutter#192789)
2026-09-15 engine-flutter-autoroll@skia.org Roll Dart SDK from 7253dff72c96 to c870e8afe036 (1 revision) (flutter/flutter#192791)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tell user about "--device-id" after the interactive multiple devices "flutter run" prompt

3 participants