jeffrey1995/MyBlog

Gradle-命令笔记

jeffrey1995 opened this issue · 0 comments

用来分析依赖包的结构:

apply plugin: 'project-report'

gradle htmlDependencyReport
open app/build/reports/project/dependencies/index.html

查看所有任务

./gradlew tasks --all

对某个module [moduleName] 的某个任务[TaskName] 运行

./gradlew :moduleName:taskName

查看构建版本

./gradlew -v

清除build文件夹

./gradlew clean

检查依赖并编译打包

./gradlew build

编译并安装debug包

./gradlew installDebug

编译并打印日志

./gradlew build --info

调试模式构建并打印日志

./gradlew build --info --debug --stacktrace

强制更新最新依赖,清除构建并构建

./gradlew clean --refresh-dependencies build

编译并打Debug包

./gradlew assembleDebug
./gradlew aD

编译并打Release的包

./gradlew assembleRelease
./gradlew aR

编译并打Debug包

./gradlew assembleDebug

编译app module 并打Debug包

./gradlew install app:assembleDebug

编译并打Release的包

./gradlew assembleRelease

Release模式打包并安装

./gradlew installRelease

卸载Release模式包

./gradlew uninstallRelease