Gradle Command Line flags for android

Updated 24 January 2024

Save

Gradle Command Line flags allow us to monitor and control the gradle activity performed in the application. We can use various flags to see what is happening and manipulate it, during the build process.

This monitoring and controlling include Logging, Listing Tasks, Profiling and like that.

In this blog, we are going to see how Profiling can be done.

Profiling a build

The --profile command line option will record some useful timing information while your build is running and write a report to the build/reports/profile directory. The report will be named using the time when the build was run.

This report lists summary times and details for both the configuration phase and task execution. The times for configuration and task execution are sorted with the most expensive operations first. The task execution results also indicate if any tasks were skipped (and the reason) or if tasks that were not skipped did no work.

Builds which utilize a buildSrc directory will generate a second profile report for buildSrc in the buildSrc/build directory.

 

Screenshot from 2016-05-12 20:59:13

Here is the  complete list of Gradle Flag available

https://docs.gradle.org/current/userguide/gradle_command_line.html

 

We can use GUI to add these gradle command line flags from

 

File > Settings…(Ctrl _ Alt + S) >  Build, Execution, Deployment > Compiler (Command-line Options)

 

Screenshot from 2016-05-12 21:03:51

Stay Updated !!

 

 

 

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home