Utilizing gradlew commands to clean and run your project in Android Studio
The gradlew
command is a robust Gradle wrapper that has excellent usage. In Android Studio, however, you do not need to install it because it is a script that comes packaged within the project.
Getting ready
For now, however, we will not look into all the Gradle commands but instead use the most popular ones to clean, build, provide info, debug, and scan our project to find any issues when we run our application. You can run the commands in your laptop’s terminal as long as you are in the correct directory or use the terminal provided by Android Studio.
How to do it…
Follow these steps to check and confirm whether Gradle works as anticipated:
- You can check the version by simply running
./gradlew
.
Figure 1.12 – gradlew version
- To build and clean your project, you can run the
./gradlew clean
and./gradlew build
commands. If anything...