Gradle breakpoint debugging

Gradle breakpoint debugging

Article link: https://blog.csdn.net/feather_wch/article/details/131746456

Run Configuration

Click the plus sign in the Run/debug configuration, select Remote JVM Debug, the default port 5005, and the default name "plugin-debug"

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005

Method (1) Select the required task in the Gradle Task, right click, and create a new task

  1. Select assembleDebug in Gradle Task, right click Modify Run Configuration
  2. Select Modify Options
  3. Select Add VM options, enter "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
  4. Find the newly added task "xxxxx" at the bottom of Run Configurations
  5. Right click and select run

Select plugin-debug at the runtime and click the Debug button

Select debug "plugin-debug"

Switch back to Task "xxxxx" at the runtime and click the Debug button

Method (2) Run Configuration,+Gradle

  1. Run Configuration, +, select Gradle
  2. Name: name "MyAssembleDebug"
  3. Gradle project: select the project
  4. Run: Enter: app:assembleDebug, you can modify: app: to other Module
  5. Select Modify Options=>Select Add VM options, enter "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"

New additions can be found in Run Configuration:

  1. Select the gradle project that needs to be debugged, "plugin-debug", and click the Debug button
  2. Select the newly created Gradle, "xxx[MyAssembleDebug]", click the Debug button

Guess you like

Origin blog.csdn.net/feather_wch/article/details/131746456