Skip to content

Support "Debug: Attach to Flutter Process" workflow for desktop #1638

Closed

Description

@stuartmorgan-g

STR:

  • Set ENABLE_FLUTTER_DESKTOP to true in dart.env
  • Clone https://github.com/google/flutter-desktop-embedding.git
  • Open flutter-desktop-embedding/example in VS Code
  • From a terminal, flutter run in flutter-desktop-embedding/example to launch the process outside of VS Code
  • Attempt to attach with Debug: Attach to Flutter Process

The desired behavior in this case is to prompt for a URI, but instead it goes directly into a mode where it waits for a connection (based on previous discussion, it sounds like it's scanning for a log message that's never going to arrive).

I have tested with a launch.json config using the URI (using 2.26b1) and it works fine, but that's a fairly painful process now that the auth token system prevents just hard-coding an observatory URI in both the app and the config and leaving it alone; every new run requires editing the launch.json again.

Activity

  1. added this to the On Deck milestone on Apr 25, 2019
  2. added
    in flutter
    is enhancement
    on Apr 25, 2019
  3. changed the title [-]New Debug: Attach to Flutter Process workflow doesn't work for desktop[/-] [+]Support "Debug: Attach to Flutter Process" workflow for desktop[/+] on Apr 25, 2019
  4. added
    in desktop
    on Apr 25, 2019
  5. DanTup commented on May 20, 2019

    @DanTup
    Member

    I'm re-purposing the Debug: Attach to Flutter Process command to prompt for a VM Service. The original command will be called Debug: Attach to Flutter on Device.

    All the new command does, is creates a launch config that includes this:

    "observatoryUri": "${command:dart.promptForVmService}"

    And dart.promptForVmService is a new command that prompts for a URI, validates it, and returns it.

    For vNext, using the command will or manually adding the above to your launch.json will be the only way to do this, but for a future release we'll have a "configurationSnippet" that pre-populates it for you in launch.json (to do this, we need to migrate from package.json configuration snippets to handling them in code - I've opened #1727 for this).

  6. modified the milestones: On Deck, v3.1.0 on May 20, 2019
  7. added a commit that references this issue on May 20, 2019
    de4d890
  8. added a commit that references this issue on May 20, 2019
    11ca3a4
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

    in desktopin flutteris enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions