Skip to content

No longer able to specify devices by partial name in deviceId field in launch.json #5854

Closed

Description

@Laurie-Lin

Title: Unable to specify Android device ID via launch.json in VS Code for Flutter development

Describe the bug
Starting from a certain version, it has become impossible to run applications by specifying Android device IDs via launch.json in VS Code.

To Reproduce
Steps to reproduce the behavior:

  1. Connect Android devices (both wired and wireless)
  2. Run flutter devices to see connected devices
  3. Configure launch.json with device ID as shown in the example
  4. Attempt to run the application via VS Code debugger

Example flutter devices output:

➜  ~ flutter devices
Found 4 connected devices:
  PLK110 (mobile) • 3B15AN013GM00000  • android-arm64  • Android 16 (API 36)
  PLK110 (mobile) • 10.205.1.239:5555 • android-arm64  • Android 16 (API 36)
  macOS (desktop) • macos             • darwin-arm64   • macOS 26.2 25C56
  darwin-arm64
  Chrome (web)    • chrome            • web-javascript • Google Chrome
  143.0.7499.169

Example launch.json configuration:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "One Plus 15",
            "request": "launch",
            "type": "dart",
            "deviceId": "PLK110",
        },
    ]
}

Expected behavior
The application should run on the specified device using the device name (e.g., "PLK110") as the deviceId in launch.json, as it worked in previous versions.

Current behavior
Regardless of whether the device is connected via wireless or wired connection, the application cannot be run by specifying the device ID in launch.json. The following error occurs:

Device "PLK110 (mobile)" was not found

Currently, the deviceId must be specified as either "3B15AN013GM00000" or "10.205.1.239:5555" (the full device identifier), whereas in previous versions this was not required.

Please complete the following information:

You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.

  • Operating System and version: macOS
  • VS Code version: 1.107.1
  • Dart extension version: 3.124.1
  • Dart/Flutter SDK version: 3.10.3/3.38.4
  • Target device: Android devices (OnePlus PLK110)

Additional context
This appears to be a regression from a previous version where specifying the device name (e.g., "PLK110") as deviceId in launch.json worked correctly. Now it requires the full device identifier instead.

Activity

  1. DanTup commented on Dec 22, 2025

    @DanTup
    Member

    Thanks for the report!

    I suspect this happened in 5f757e4, where this code was added:

    deviceToLaunchOn = await this.deviceManager?.waitForDevice(debugConfig.deviceId as string | undefined, fiveSecondsInMs);
    if (!deviceToLaunchOn) {
    logger.warn(`Unable to launch because device ${debugConfig.deviceId} could not be found`);
    void window.showInformationMessage(`Device "${debugConfig.deviceId}" was not found`);
    return "UNABLE_TO_LAUNCH";
    }

    Before, we probably just passed the ID through to Flutter, and flutter run accepts the device name as well as the ID (as long as it's unique), but this change assumed we were only ever using IDs.

    We should update this code so that if it doesn't find a device by ID, it does the same substring match as Flutter, and if there's only one match, then it selects that ID.

  2. added this to the v3.128.0 milestone on Dec 22, 2025
  3. changed the title [-]Unable to specify Android device ID via launch.json in VS Code[/-] [+]No longer able to specify devices by name in `deviceId` field in launch.json[/+] on Dec 22, 2025
  4. changed the title [-]No longer able to specify devices by name in `deviceId` field in launch.json[/-] [+]No longer able to specify devices by partial name in `deviceId` field in launch.json[/+] on Dec 22, 2025
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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions