Skip to content

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

Closed

Description

@jmagman

flutter run now interactively prompts for which device to run when multiple devices are available, and no --device flag was specified.

Multiple devices found:
iPhone 6s (mobile)     • <device-id-1> • ios            • iOS 13.5.1
iPhone 8 Plus (mobile) • <device-id-2>     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
macOS (desktop)        • macos                                    • darwin-x64     • Mac OS X 10.15.5 19F101
Web Server (web)       • web-server                               • web-javascript • Flutter Tools
Chrome (web)           • chrome                                   • web-javascript • Google Chrome 84.0.4147.105
[0]: iPhone 6s (device-id-1)
[1]: iPhone 8 Plus (device-id-2)
[2]: macOS (macos)
[3]: Web Server (web-server)
[4]: Chrome (chrome)
Please choose one: [0|1|2|3|4]: 
1
Running "flutter pub get" in test_create...

After the device selection, it would be nice to print something like:

To run on this device next time, try "flutter <exactly the command they ran> --device-id <selected device ID>"

like:

To always run on this device next time, try "flutter run --release --device-id 23049829583405983"

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    a: first hourThe first hour of using Flutter
    P3Issues that are less important to the Flutter project
    on Aug 12, 2020
  2. yashugarg commented on Nov 2, 2020

    @yashugarg

    @jonahwilliams I'd like to work on this issue please guide me

  3. jmagman commented on Nov 2, 2020

    @jmagman
    MemberAuthor

    @yashugarg Probably a _logger.printStatus around

    final Device chosenDevice = await _chooseOneOfAvailableDevices(devices);
    specifiedDeviceId = chosenDevice.id;

    Try playing around with it, and ask specific questions if you have them. "please guide me" may as well mean "please do this for me and put my name on it" 😉

  4. christopherfujino commented on Nov 2, 2020

    @christopherfujino
    Contributor

    @jonahwilliams I'd like to work on this issue please guide me

    Hi @yashugarg, thanks for your willingness to contribute. However, if you're not sure how to fix this particular issue, perhaps you should start with an issue that you have more context around. The best way to start contributing code to Flutter is to fix a problem that you have with your Flutter app, and then submit that fix upstream.

  5. added
    tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.
    on Jul 7, 2025
  6. theprantadutta commented on May 13, 2026

    @theprantadutta
    Contributor

    Hi — is this still open for outside contributions? Looks like the 2020 volunteer didn't follow through. Plan, based on @jmagman's pointer upthread:

    1. After the interactive multi-device prompt resolves to a specific device in packages/flutter_tools/lib/src/device.dart (around the findTargetDevices/_chooseOneOfMultipleDevices flow @jmagman linked), emit a one-line hint via _logger.printStatus, something like:

      Tip: pass --device-id=<id> to skip this prompt next time.

    2. Add a flutter_tools unit test asserting the hint is printed in the multi-device interactive path.

    Happy to defer if you'd rather not change this output, or to tweak wording / placement if you prefer it elsewhere.

  7. theprantadutta commented on Jul 3, 2026

    @theprantadutta
    Contributor

    PR is up: #188941. It prints the hint after the user picks a device in both selection flows (the standard one and the macOS wireless-discovery one — in the latter it prints after selection completes, so it doesn't interfere with the line clearing that happens when wireless results arrive mid-prompt). Updated the 17 interactive-selection tests that assert full status text, plus an assertion that the hint carries the chosen device's id. It's a draft for now only because of the open-PR limit for outside contributors — I'll mark it ready as soon as one of my other PRs frees a slot.

  8. github-actions commented on Sep 29, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: first hourThe first hour of using Flutterteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions