text
stringlengths
1
372
file >
open >
Project/Solution…
you can also press ctrl + shift + o.
choose the build/windows/my_app.sln file in your flutter app directory.
go to debug > attach to process.
you can also press ctrl + alt + p.
from the attach to process dialog box, choose my_app.exe.
visual studio starts monitoring the flutter app.
<topic_end>
<topic_start>
start debugging with visual studio first
if you use visual studio to debug most of your code, start with this section.
<topic_end>
<topic_start>
start the local windows debugger
to open the project solution file, go to
file >
open >
Project/Solution…
you can also press ctrl + shift + o.
choose the build/windows/my_app.sln file in your flutter app directory.
set my_app as the startup project.
in the solution explorer, right-click on my_app and select
set as startup project.
click local windows debugger to start debugging.
you can also press f5.
when the flutter app has started, a console window displays
a message with the dart VM service URI. it resembles the following response:
copy the dart VM service URI.
<topic_end>
<topic_start>
attach to the dart VM in VS code
to open the command palette, go to
view >
command palette…
you can also press cmd + shift + p.
type debug.
click the debug: attach to flutter on device command.
in the paste an VM service URI box, paste the URI you copied
from visual studio and press enter.
<topic_end>
<topic_start>
resources
check out the following resources on debugging flutter, iOS, android,
macOS and windows:
<topic_end>
<topic_start>
flutter
<topic_end>
<topic_start>
android
you can find the following debugging resources on
developer.android.com.
<topic_end>
<topic_start>
iOS and macOS
you can find the following debugging resources on
developer.apple.com.
<topic_end>
<topic_start>
windows
you can find debugging resources on microsoft learn.
<topic_end>
<topic_start>
flutter's build modes
the flutter tooling supports three modes when compiling your app,
and a headless mode for testing.
you choose a compilation mode depending on where you are in
the development cycle. are you debugging your code? do you
need profiling information? are you ready to deploy your app?
a quick summary for when to use which mode is as follows:
the rest of the page details these modes.
<topic_end>
<topic_start>
debug
in debug mode, the app is set up for debugging on the physical
device, emulator, or simulator.
debug mode for mobile apps mean that:
debug mode for a web app means that:
by default, flutter run compiles to debug mode.
your IDE supports this mode. android studio,
for example, provides a run > debug… menu option,
as well as a green bug icon overlaid with a small triangle
on the project page.
info note
<topic_end>
<topic_start>
release
use release mode for deploying the app, when you want maximum
optimization and minimal footprint size. for mobile, release mode
(which is not supported on the simulator or emulator), means that:
release mode for a web app means that:
the command flutter run --release compiles to release mode.
your IDE supports this mode. android studio, for example,
provides a run > run… menu option, as well as a triangular
green run button icon on the project page.
you can compile to release mode for a specific target
with flutter build <target>. for a list of supported targets,
use flutter help build.