Skip to content

Latest commit

 

History

History
56 lines (33 loc) · 1.63 KB

DEBUGGING.MD

File metadata and controls

56 lines (33 loc) · 1.63 KB

Debugging dangerfile.dart

  1. You need to add --debug to any command you wanted to run.
  2. Waiting for the text Observatory listening on http://127.0.0.1:8181/xxxxxxx=/
  3. Don't forget to put breakpoints in your dangerfile.dart

On your editor

VSCode

  1. Open .vscode/launch.json or create one if you don't have it.

  2. Add following configuration

    {
      "name": "Danger Attach",
      "type": "dart",
      "request": "attach",
      "program": "tool/dangerfile.dart"
    }

    Note: It doesn't have to point to your dangerfile.dart , any dart file inside folder bin or tool in your workspace should be fine. More detail

  3. Press Run on Danger Attach in Run and Debug tab

  4. VSCode will ask for VM Service URI

Image of VSCode Step 1

  1. It will start at yourdangerfile.dart.g.dart, you can skip it

Intellij or Android Studio

  1. Go to Run > Edit Configurations...

Image of Intellij Step 1

  1. Press + button and select Dart Remote Debug

Image of Intellij Step 2

  1. Put 'Debug Danger' into name field, and press OK

Image of Intellij Step 3

  1. On the main window, select Debug Danger and press Debug

Image of Intellij Step 4

  1. It will ask for VM Service URI

Image of Intellij Step 5

  1. It will start at yourdangerfile.dart.g.dart, you can skip it