./gradlew -v
# 清除build文件夹
./gradlew clean
# 检查依赖并编译打包
./gradlew build
# 编译并安装debug包
./gradlew installDebug
# 编译并打印日志
./gradlew build --info
# 译并输出性能报告,性能报告一般在 构建工程根目录 build/reports/profile
./gradlew build --profile
# 调试模式构建并打印堆栈日志
./gradlew build --info --debug --stacktrace
# 强制更新最新依赖,清除构建并构建
./gradlew clean build --refresh-dependencies
# 编译并打Debug包
./gradlew assembleDebug
# 编译并打Release的包
./gradlew assembleRelease
使用命令行打Release包,出现未签名包时,会出现安装包解析出错-103
检查
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.config #此处需要配置签名
}
}
#签名配置
signingConfigs {
config {
keyAlias 'xxx'
keyPassword 'xxxx'
storeFile file('/Users/xx/Documents/project/xx/xx.jds')
storePassword 'xxx'
v1SigningEnabled true
v2SigningEnabled true
}
}