Skip to content

flutter attach fails to attach to macos app #183248

Open

Description

@kenzieschmoll
  1. Create an app that runs on all platforms: flutter create some_app
  2. Run flutter attach from the some_app/ directory
  3. In another terminal, run flutter run -d macos from the some_app/ directory
  4. Observe, the flutter attach command times out waiting for the VM service connection
Image

If you happen to have a simulator open, and then repeat steps 2 & 3, flutter attach assumes it is waiting for a connection on the iOS simulator even though the app I'm trying to connect to was ran on the macos target.

Image
Flutter 3.41.0-1.0.pre-861 • channel [user-branch] • unknown source
Framework • revision d3dd7744e8 (3 hours ago) • 2026-03-04 11:32:22 -0600
Engine • hash f6413c9a1d1e846b1efca8e6918b7144f74cbec7 (revision eb0b756f6e) (7 hours ago) • 2026-03-04
12:29:36.000Z
Tools • Dart 3.12.0 (build 3.12.0-201.0.dev) • DevTools 2.55.0

CC @bkonyi @vashworth

Activity

  1. vashworth commented on Mar 4, 2026

    @vashworth
    Contributor

    If you happen to have a simulator open, and then repeat steps 2 & 3, flutter attach assumes it is waiting for a connection on the iOS simulator even though the app I'm trying to connect to was ran on the macos target.

    That's likely because the Flutter tool will automatically select an open simulator instead of macos, if the device is not specified in the command. And flutter attach doesn't have a way of knowing if that's the correct device so it'll attempt to connect and fail/wait forever: #130623

  2. jmagman commented on Mar 4, 2026

    @jmagman
    Member

    Does flutter attach -d macos work?

  3. kenzieschmoll commented on Mar 5, 2026

    @kenzieschmoll
    MemberAuthor

    Does flutter attach -d macos work?

    No it does not:

    Image
  4. saurabh-mirajkar commented on Mar 9, 2026

    @saurabh-mirajkar
    Contributor

    @vashworth thanks for the report. Labelling this for further investigation.

  5. added
    team-macosOwned by the macOS platform team
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    team-toolOwned by Flutter Tool team
    on Mar 10, 2026
  6. loic-sharma commented on Mar 11, 2026

    @loic-sharma
    Member

    cc @knopp to see if you can reproduce.

  7. added
    P2Important issues not at the top of the work list
    triaged-macosTriaged by the macOS platform team
    on Apr 2, 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

    P2Important issues not at the top of the work listplatform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyteam-macosOwned by the macOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-macosTriaged by the macOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions