Flutter的附加调试器输出在哪里?

时间:2019-06-03 02:55:54

标签: debugging flutter visual-studio-code android-debug vscode-debugger

  • 对于本实验,我使用的是未经修改的默认Flutter项目,该项目正在通过USB在Note 9上进行测试。
  • VS代码版本:1.34.0。
  • Dart扩展程序版本:3.1.0。
  • Flutter扩展版本:3.1.0。
  • Flutter Doctor输出:
[√] 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)

每当我在终端中输入“ flutter run”时,一切都会顺利进行,即热重装和重启工作,还将日志和打印输出记录到终端!

当我单击“调试”面板上的“开始调试”时,情况也是如此。唯一的区别是,我必须使用CTRL + F5和CTRL + SHIFT + F5(而不是在终端中输入“ r”和“ R”)进行热重载和重新启动,并且还要将输出记录和打印到“调试控制台”。

我的问题是由于从此更改默认的launch.json文件导致的。

{
    // 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"
        }
    ]
}

对此...

{
    // 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"
        }
    ]
}

现在,每当我单击“开始调试”时,我的打印和日志都不会显示在任何地方!它们可以输出到哪里?

0 个答案:

没有答案