Skip to content

Using "args" in launch.json for an attach request reports an error #3431

@cycloss

Description

@cycloss

Describe the bug

When trying to attach the debugger to a flutter app I get the error message:

There are multiple observatory ports available.
Rerun this command with one of the following passed in as the appId:

  flutter attach --app-id com.example.myApp
  flutter attach --app-id com.example.myApp (2)

However, there is no configuration option available for type dart in the launch.json for me to be able to specify app-id

My launch.json looks like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "debug app",
            "request": "attach",
            "type": "dart",
            "deviceId": "51ABDF9C-C54D-4811-BBDA-E733639AEC51",
        },
    ]
}

To Reproduce
Steps to reproduce the behavior:

  1. Run an app in the terminal with flutter run
  2. Run the debug app launch config specified above.

I've also tried not launching with flutter run by just tapping on the app in the emulator and then trying to attach but the same problem occurs.

Expected behavior

I expected to be able to attach to the running process.

Versions (please complete the following information):

  • VS Code version: 1.57.1
  • Dart extension version: 3.23.1
  • Dart/Flutter SDK version: Flutter 2.2.1, Dart 2.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsis bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions