gradle Common Commands
1. Gragle Common Commands
Before touching some of the commands such as
./Gradlew -V
./Gradlew Clean
./Gradlew Build,
Note that all are ./gradlew, ./ represents the current directory, Gradlew represents Gradle wrapper, which means a layer of gradle packaging, It can be understood that Gradle is encapsulated locally in this project, that is, Gradle wrapper, as long as the download is successful, the Grdlew wrapper command instead of the Global gradle command.
Understanding the concept of Gradle wrapper, here are some common commands:
- ./gradlew-v Version Number
- ./gradlew Clean Clear .../app directory under the Build folder
- ./gradlew build check dependencies and compile package
Note here that the./gradlew build command to the debug, Release environment package all out, if the official release only need to hit release package, what to do, the following is a very useful command **assemble**, such as
- ./gradlew Assembledebug compiles and hits the debug package
- ./gradlew Assemblerelease compiling and playing the release package
- ./gradlew installrelease Release mode package and install
- ./gradlew Uninstallrelease Uninstall Release Mode pack
Second, attached: Build structure directory
Tree
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 66676869707172737475767778798081828384858687888990 |
build/├──apk├──assets│├──debug│└──Release├──classes│├──debug││└──com││└──example││└──gradle│└──Release│└──com│└──example│└──gradle├──dependency-cache│├──debug│└──Release├──incremental│├──aidl││├──debug││└──Release│├──dex││├──debug││└──Release│├──mergeassets││├──debug││└──Release│└──mergeresources│├──debug│└──Release├──libs├──manifests│├──debug│└──Release├──res│├── All││├──debug│││├──drawable-hdpi│││├──drawable-mdpi│││├──drawable-xhdpi│││├──d Rawable-xxhdpi│││├──layout│││├──menu│││├──values│││├──values-sw720dp-land│││ ├──values-v11│││└──values-v14││└──Release││├──drawable-hdpi││├──drawable-mdpi││├──drawable-xhdpi││├──drawable-xxhdpi│ │├──layout││├──menu││├──values││├──values-sw720dp-land││├──values-v11 ││└──values-v14│└──rs│├──debug│└──Release├──source│├──aidl││├──debug││└──Release│├──buildconfig││├──debug│││└──com│││└──example│││└──gradle││└─ -Release││└──com││└──example││└──gradle│├──r││├──debug│││└──com│ ││└──example│││└──gradle││└──Release││└──com││└──example││└──gradle│└──rs│├──debug│└──Release└──symbols├──debug└──ReleaseDirectories |
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Gradle Common Commands