Debugging Gradle build scripts & Plugins [IntelliJ/Android Studio]

How to debug Gradle build scripts & Plugins using IntelliJ or Android Studio in 3 simple steps.

Maxi Rosson
Mar 25 · 2 min read

What do you can debug?

You can set breakpoints and debug:

  • The directory
  • Standalone Gradle plugins
  • Any file on your project (only if you use )

1. Configure IntelliJ / Android Studio

The first step is to create a new in / on the project you want to debug.

Go to the configurations icon, and click on

Then click on the symbol and pick

Finally, assign a name (for example ) and click on

2. Execute the task to debug

Now you can execute the task to debug. You need to add the following flags:

For example:

./gradlew help -Dorg.gradle.debug=true --no-daemon

3. Attach the debugger

The previous task will wait until you attach the debugger. To do that, just pick the configuration and then click the icon on the project to be debugged.

The Debug icon

For more info, you can read the Gradle documentation.

Follow us for more productivity tools & ideas for Android, Kotlin & Gradle projects.

Dipien

Boost your Productivity

Maxi Rosson

Written by

Developer Productivity Engineer | Android | Productivity tools & ideas for Android, Kotlin & Gradle developers on medium.dipien.com

Dipien

Dipien

Productivity tools & ideas for Android, Kotlin & Gradle developers.

Maxi Rosson

Written by

Developer Productivity Engineer | Android | Productivity tools & ideas for Android, Kotlin & Gradle developers on medium.dipien.com

Dipien

Dipien

Productivity tools & ideas for Android, Kotlin & Gradle developers.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store