Where does Flutter's attach debugger output to?

1,190

Flutter attach shows output to the DevTools debugger and profiler, you have to open that and provide it with the URL for the running app.

Share:
1,190
Landon
Author by

Landon

Updated on December 11, 2022

Comments

  • Landon
    Landon over 1 year
    • For this experiment, I am using an unmodified default Flutter project which I am testing on a note 9 over usb.
    • VS Code version: 1.34.0.
    • Dart extension version: 3.1.0.
    • Flutter extension version: 3.1.0.
    • Flutter doctor output:
    [√] Android toolchain - develop for Android devices
        (Android SDK version 28.0.3)
        • Android SDK at C:\Users\Landon
          Blackledge\AppData\Local\Android\sdk
        • Android NDK location not configured (optional;
          useful for native profiling support)
        • Platform android-28, build-tools 28.0.3
        • Java binary at: C:\Program Files\Android\Android
          Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build
          1.8.0_152-release-1343-b01)
        • All Android licenses accepted.
    
    [!] Android Studio (version 3.4)
        • Android Studio at C:\Program
          Files\Android\Android Studio
        X Flutter plugin not installed; this adds Flutter
          specific functionality.
        X Dart plugin not installed; this adds Dart
          specific functionality.
        • Java version OpenJDK Runtime Environment (build
          1.8.0_152-release-1343-b01)
    
    [√] VS Code, 64-bit edition (version 1.34.0)
        • VS Code at C:\Program Files\Microsoft VS Code
        • Flutter extension version 3.1.0
    
    [√] Connected device (1 available)
        • SM N960U • 29d9117531047ece • android-arm64 •
          Android 9 (API 28)
    

    Whenever I enter "flutter run" in terminal, everything runs smoothly, i.e., hot reload & restart work & also logs & prints output to terminal!

    The same is true, whenever I click "Start Debugging" on the "Debug" panel; the only differences being that I must use CTRL+F5 & CTRL+SHIFT+F5 (rather than entering "r" & "R" in terminal) for hot reload & restart & also logs & prints output to "DEBUG CONSOLE".

    My issue results from changing the default launch.json file from this...

    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Flutter",
                "request": "launch",
                "type": "dart"
            }
        ]
    }
    

    to this...

    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Flutter",
                "request": "attach",
                "type": "dart"
            }
        ]
    }
    

    Now, whenever I click "Start Debugging", my prints & logs don't show up ANYWHERE! Where could they be outputting to?