1. Create debugger

    Run->Edit Configurations
    Edit configurations

    Add New Configuration
    Add New Configuration

    Add Remote configuration
    Add Remote configuration

  2. Open debug mode

    $ export GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
    
  3. Start debugger

    $ ./gradlew someTask -Dorg.gradle.daemon=false #!important, disable daemon mode
    
  4. Attach debugger

    Set breakpoints
    Add Remote configuration

    Start debug
    Add Remote configuration

  5. Disable debug mode

    $ unset GRADLE_OPTS
    

Comments