Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dart DevTools showing "Connect to a running app"

I can't start the Dart Dev Tools in VS Code, when I launch in debugging mode it opens a chrome window says Connect to a running app Enter a port or URL to a running Dart or Flutter application.

When I hover over the Dart DevTools button, it shows a port but I still can't connect to it.

Any ideas?

like image 505
Jonas Avatar asked Jul 28 '19 16:07

Jonas


2 Answers

Start your flutter app with --observatory-port option. For example,

flutter run --observatory-port=9200

Once the app starts, you’ll see a message in your terminal that looks like:

An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:9200/Swm0bjIe0ks=/

Paste the URL you got from running your app (http://127.0.0.1:9200/Swm0bjIe0ks=/) into the connect dialog to connect your app to DevTools.

Hope this helps.

like image 128
Hayeong Choi Avatar answered Sep 22 '22 02:09

Hayeong Choi


In Run flutter in Terminal with port you want. It can 9200 or 9300 or 9301 etc flutter run --observatory-port=9200

On the logcat you will see message look like "An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:9200/Swm0bjIe0ks=/"

After that copy and past url (http://127.0.0.1:9200/Swm0bjIe0ks=/) to dialog connect your app to DevTools

like image 38
Uri Goo Avatar answered Sep 23 '22 02:09

Uri Goo