- Set breakpoints somewhere.
- Start building the project from the terminal:
$ ./gradlew --no-daemon -Dorg.gradle.debug=true clean build
. Gradle will wait for you to attach a debugger at localhost:5005 by default. - Create a default remote debug configuration: Run -> Edit Configurations... -> Add New Configuration (Alt + Insert) -> Remote.
- Debug using just created remote configuration within the IDE: Run -> Debug... (Alt + Shift + F9).
Hope it helps somebody :)