0%

Android Studio 调试 Gradle 插件

  1. 命令行到Project ,输入:

    GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
    ./gradlew 你的task --no-daemon -Dorg.gradle.debug=true
  2. 插件源码打上断点

  3. Eidt Configurations+remoteok

  4. 点击 debug ,开始调试

参考:

https://github.com/robolectric/robolectric-gradle-plugin/wiki/Debugging-the-Plugin