./gradlew clean clean项目
./gradlew build 构建项目
/gradlew assembleDebug or /gradlew aD 编译并打Debug包
./gradlew assembleRelease or /gradlew aR 编译并打Release的包
./gradlew installRelease or /gradlew iR Release模式打包并安装
./gradlew installDebug or /gradlew iD Debug模式打包并安装
./gradlew uninstallRelease or ./gradlew uR 卸载Release模式包
./gradlew uninstallDebug or ./gradlew uD 卸载Debug模式包
需要说明的是这些命令可以叠加使用,例如:
./gradlew clean build --info > bugtags.log
android {
//签名设置
signingConfigs {
release {
keyAlias '...'
keyPassword '...'
storeFile file('../xx.jks')//加"../"表示该文件位于上一级即项目根路径下
storePassword '...'
}
debug {
keyAlias '...'
keyPassword '...'
storeFile file('../xx.jks')
storePassword '...'
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
debug {
...
signingConfig signingConfigs.debug
}
}
}