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
- Select assembleDebug in Gradle Task, right click Modify Run Configuration
- Select Modify Options
- Select Add VM options, enter "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
- Find the newly added task "xxxxx" at the bottom of Run Configurations
- 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
- Run Configuration, +, select Gradle
- Name: name "MyAssembleDebug"
- Gradle project: select the project
- Run: Enter: app:assembleDebug, you can modify: app: to other Module
- 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:
- Select the gradle project that needs to be debugged, "plugin-debug", and click the Debug button
- Select the newly created Gradle, "xxx[MyAssembleDebug]", click the Debug button