Debugging

You may be used to having your suite of favorite Flutter debugging tools
available to you automatically when running flutter run or an equivalent
command from an IDE. But you can also use all your Flutter
debugging functionalities such as hot reload, performance
overlays, DevTools, and setting breakpoints in add-to-app scenarios.

These functionalities are provided by the flutter attach mechanism.
flutter attach can be initiated through different pathways,
such as through the SDK’s CLI tools,
through VS Code or IntelliJ/Android Studio.

flutter attach can connect as soon as you run your FlutterEngine, and
remains attached until your FlutterEngine is disposed. But you can invoke
flutter attach before starting your engine. flutter attach waits for
the next available Dart VM that is hosted by your engine.

Terminal

Run flutter attach or flutter attach -d deviceId to attach from the terminal.

VS Code