text
stringlengths
1
372
launch DevTools from the toolbar/menu
once an app is running,
you can start DevTools using one of the following:
<topic_end>
<topic_start>
launch DevTools from an action
you can also open DevTools from an IntelliJ action.
open the find action… dialog
(on macOS, press cmd + shift + a),
and search for the open DevTools action.
when you select that action,
DevTools is installed (if it isn’t already), the DevTools server
launches, and a browser instance opens pointing to the DevTools app.
when opened with an IntelliJ action, DevTools is not connected
to a flutter app. you’ll need to provide a service protocol port
for a currently running app. you can do this using the inline
connect to a running app dialog.
<topic_end>
<topic_start>
install and run DevTools from VS code
<topic_end>
<topic_start>
install the VS code extensions
to use the DevTools from VS code, you need the dart extension.
if you’re debugging flutter applications, you should also install
the flutter extension.
<topic_end>
<topic_start>
start an application to debug
start a debug session for your application by opening the root
folder of your project (the one containing pubspec.yaml)
in VS code and clicking run > start debugging (f5).
<topic_end>
<topic_start>
launch DevTools
once the debug session is active and the application has started,
the open DevTools commands become available in the
VS code command palette (f1):
the chosen tool will be opened embedded inside VS code.
you can choose to have DevTools always opened in a browser with the
dart.embedDevTools setting, and control whether it opens as a full window or
in a new column next to your current editor with the dart.devToolsLocation
setting.
a full list of Dart/Flutter settings are available
here or in the
VS code settings editor.
some recommendation settings for Dart/Flutter in VS code can be found
here.
you can also see whether DevTools is running and launch it in a browser from the
language status area (the {} icon next to dart in the status bar).
<topic_end>
<topic_start>
install and run DevTools from the command line
to run dart DevTools from the CLI, you must have dart on your path. then
you can run the following command to launch DevTools:
to upgrade DevTools, upgrade your dart SDK. if a newer dart SDK
includes a newer version of DevTools, dart devtools will automatically
launch this version. if which dart points to the dart SDK included in
your flutter SDK, then DevTools will be upgraded when you upgrade your
flutter SDK to a newer version.
when you run DevTools from the command line, you should see output that
looks something like:
<topic_end>
<topic_start>
start an application to debug
next, start an app to connect to.
this can be either a flutter application
or a dart command-line application.
the command below specifies a flutter app:
you need to have a device connected, or a simulator open,
for flutter run to work. once the app starts, you’ll see a
message in your terminal that looks like the following:
open the DevTools instance connected to your app
by opening the second link in chrome.
this URL contains a security token,
so it’s different for each run of your app.
this means that if you stop your application and re-run it,
you need to connect to DevTools again with the new URL.
<topic_end>
<topic_start>
connect to a new app instance
if your app stops running
or you opened DevTools manually,
you should see a connect dialog:
you can manually connect DevTools to a new app instance
by copying the observatory link you got from running your app,
such as http://127.0.0.1:52129/QjqebSY4lQ8=/
and pasting it into the connect dialog:
<topic_end>
<topic_start>
using the flutter inspector
info note
the inspector works with all flutter applications.
<topic_end>
<topic_start>
what is it?
the flutter widget inspector is a powerful tool for visualizing and
exploring flutter widget trees. the flutter framework uses widgets
as the core building block for anything from controls
(such as text, buttons, and toggles),