Repository navigation
Commit b5e159f
Suggest the -d flag after interactive device selection (flutter#188941)
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
flutter#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 flutter#63541
## 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.
<!-- 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/
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Co-authored-by: Ben Konyi <[email protected]>1 parent 0734985 commit b5e159f
2 files changed
Lines changed: 42 additions & 9 deletions
File tree
- packages/flutter_tools
- lib/src/runner
- test/general.shard/runner
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
349 | 351 | | |
350 | 352 | | |
351 | 353 | | |
352 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
353 | 357 | | |
354 | 358 | | |
355 | 359 | | |
| |||
733 | 737 | | |
734 | 738 | | |
735 | 739 | | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
736 | 745 | | |
737 | 746 | | |
738 | 747 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| 669 | + | |
669 | 670 | | |
670 | 671 | | |
671 | 672 | | |
| |||
716 | 717 | | |
717 | 718 | | |
718 | 719 | | |
| 720 | + | |
719 | 721 | | |
720 | 722 | | |
721 | 723 | | |
| |||
739 | 741 | | |
740 | 742 | | |
741 | 743 | | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
742 | 751 | | |
743 | 752 | | |
744 | 753 | | |
| |||
765 | 774 | | |
766 | 775 | | |
767 | 776 | | |
| 777 | + | |
768 | 778 | | |
769 | 779 | | |
770 | 780 | | |
| |||
901 | 911 | | |
902 | 912 | | |
903 | 913 | | |
| 914 | + | |
904 | 915 | | |
905 | 916 | | |
906 | 917 | | |
| |||
926 | 937 | | |
927 | 938 | | |
928 | 939 | | |
| 940 | + | |
929 | 941 | | |
930 | 942 | | |
931 | 943 | | |
| |||
954 | 966 | | |
955 | 967 | | |
956 | 968 | | |
| 969 | + | |
957 | 970 | | |
958 | 971 | | |
959 | 972 | | |
| |||
1755 | 1768 | | |
1756 | 1769 | | |
1757 | 1770 | | |
1758 | | - | |
| 1771 | + | |
| 1772 | + | |
1759 | 1773 | | |
1760 | 1774 | | |
1761 | 1775 | | |
| |||
1801 | 1815 | | |
1802 | 1816 | | |
1803 | 1817 | | |
1804 | | - | |
| 1818 | + | |
| 1819 | + | |
1805 | 1820 | | |
1806 | 1821 | | |
1807 | 1822 | | |
| |||
2147 | 2162 | | |
2148 | 2163 | | |
2149 | 2164 | | |
2150 | | - | |
| 2165 | + | |
| 2166 | + | |
2151 | 2167 | | |
2152 | 2168 | | |
2153 | 2169 | | |
| |||
2187 | 2203 | | |
2188 | 2204 | | |
2189 | 2205 | | |
2190 | | - | |
| 2206 | + | |
| 2207 | + | |
2191 | 2208 | | |
2192 | 2209 | | |
2193 | 2210 | | |
| |||
2224 | 2241 | | |
2225 | 2242 | | |
2226 | 2243 | | |
| 2244 | + | |
2227 | 2245 | | |
2228 | 2246 | | |
2229 | 2247 | | |
| |||
2272 | 2290 | | |
2273 | 2291 | | |
2274 | 2292 | | |
| 2293 | + | |
2275 | 2294 | | |
2276 | 2295 | | |
2277 | 2296 | | |
| |||
2329 | 2348 | | |
2330 | 2349 | | |
2331 | 2350 | | |
2332 | | - | |
| 2351 | + | |
| 2352 | + | |
2333 | 2353 | | |
2334 | 2354 | | |
2335 | 2355 | | |
| |||
2385 | 2405 | | |
2386 | 2406 | | |
2387 | 2407 | | |
2388 | | - | |
| 2408 | + | |
| 2409 | + | |
2389 | 2410 | | |
2390 | 2411 | | |
2391 | 2412 | | |
| |||
2574 | 2595 | | |
2575 | 2596 | | |
2576 | 2597 | | |
2577 | | - | |
| 2598 | + | |
| 2599 | + | |
2578 | 2600 | | |
2579 | 2601 | | |
2580 | 2602 | | |
| |||
2614 | 2636 | | |
2615 | 2637 | | |
2616 | 2638 | | |
2617 | | - | |
| 2639 | + | |
| 2640 | + | |
2618 | 2641 | | |
2619 | 2642 | | |
2620 | 2643 | | |
| |||
2649 | 2672 | | |
2650 | 2673 | | |
2651 | 2674 | | |
| 2675 | + | |
2652 | 2676 | | |
2653 | 2677 | | |
2654 | 2678 | | |
| |||
0 commit comments