Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not debug flutter app on Windows because of missing toolArgs #140

Open
xhcoding opened this issue Jan 21, 2022 · 3 comments
Open

can not debug flutter app on Windows because of missing toolArgs #140

xhcoding opened this issue Jan 21, 2022 · 3 comments

Comments

@xhcoding
Copy link

When I debug flutter app with default flutter debug template, it's failed.
By debug flutter with vscode , I found lsp-dart-dap missing toolArgs in launch args .

so I edit debug template, add toolArgs make dap-debug normally, like this:

(dap-register-debug-template
  "Flutter :: Debug"
  (list :name "Flutter :: Debug"
        :type "flutter"
        :toolArgs
        ["-d"
         "windows"
         "--dart-define=flutter.inspector.structuredErrors=true"
         "--web-allow-expose-url"
         "--devtools-server-address"
         "http://127.0.0.1:9100/"]))

Obviously, "windows" is the device id ,I hope it can be automatically populated through the debugging device I choose

@ericdallo
Copy link
Member

thanks for the report!
@DanTup is toolArgs necessary for the debugger work?

@DanTup
Copy link

DanTup commented Jan 24, 2022

toolArgs should not be necessary, but if you want to specify a specific Device (rather than letting the Flutter tool decide which to use if there are multiple) you'll need to pass it.

As for the other flags here, I think structured errors are enabled by default so that flag shouldn't be required. --web-allow-expose-url is for web proxies when using web devices (so not required for Windows), and --devtools-server-address is for an IDE to pass an existing DevTools server to Flutter (so it doesn't start its own) so also not required here if your IDE is not spawning a server.

So the only thing you might really want is -d deviceId. In VS Code we use flutter daemon to monitor for devices and present them in a pick-list for the user, and pass the selected one when starting Flutter. Info about the device daemon is here:

https://github.com/flutter/flutter/blob/master/packages/flutter_tools/doc/daemon.md

@ericdallo
Copy link
Member

Thanks @DanTup we actually do the same on lsp-dart, I was just not sure if we should pass those args with a default or just don't pass at all if not user didn't overide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants