Skip to content

Latest commit

 

History

History
80 lines (56 loc) · 2.86 KB

File metadata and controls

80 lines (56 loc) · 2.86 KB
  1. Click the Attach debugger to Android process button. (Tiny green bug superimposed with a light grey arrow)

    :::tip If this button doesn't appear in the Projects menu bar, verify that you opened Flutter application project but not a Flutter plugin. :::

  2. The process dialog displays one entry for each connected device. Select show all processes to display available processes for each device.

  3. Choose the process to which you want to attach. For this guide, select the com.example.my_app process using the Emulator Pixel_5_API_33.

{% comment %}

@atsansone - 2023-07-24

These screenshots were commented out for two reasons known for most docs:

  1. The docs should stand on their own.
  2. These screenshots would be painful to maintain.

If reader feedback urges their return, these will be uncommented.

Attach to Process dialog box open in Android Studio

Flutter app in Android device displaying two buttons.

{% endcomment %}
  1. Locate the tab for Android Debugger in the Debug pane.

  2. In the Project pane, expand my_app_android > android > app > src > main > java > io.flutter plugins.

  3. Double click GeneratedProjectRegistrant to open the Java code in the Edit pane.

{% comment %} 'The Android Project view highlighting the GeneratedPluginRegistrant.java file.'{:width="100%"}

The Android Project view highlighting the GeneratedPluginRegistrant.java file.

{% endcomment %}

At the end of this procedure, both the Dart and Android debuggers interact with the same process. Use either, or both, to set breakpoints, examine stack, resume execution and the like. In other words, debug!

{% comment %} The Dart debug pane with two breakpoints set in lib/main.dart{:width="100%"}

The Dart debug pane with two breakpoints set in lib/main.dart.

{% endcomment %}

{% comment %} 'The Android debug pane with one breakpoint set in GeneratedPluginRegistrant.java.'

The Android debug pane with one breakpoint set in GeneratedPluginRegistrant.java.

{% endcomment %}