I've several build types in my build.gradle:
signingConfigs {
debug {
storeFile file("debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
unsigned{
storePassword = ""
keyAlias = ""
keyPassword = ""
}
release {
storeFile file("release.keystore")
keyAlias "alias"
storePassword "foo"
keyPassword "bar"
}
}
buildTypes {
release {
debuggable false
jniDebugBuild false
signingConfig signingConfigs.release
}
unsigned {
debuggable false
jniDebugBuild false
signingConfig signingConfigs.unsigned
}
debug {
debuggable true
jniDebugBuild true
signingConfig signingConfigs.debug
}
}
which work fine but the problem is that I don't know (and I haven't find after lot of searching) a way how to build only single build type either from Android Studio or command-line.
Do you please know?
gradle files in an Android Studio project?
Build types define certain properties that Gradle uses when building and packaging your app, and are typically configured for different stages of your development lifecycle.
assemble will build your artifacts, and build will assemble your artifacts with additional checks. You can have a look on the tasks that will be executed by using the --dry-run flag. e.g. You will see that apart from assemble also lint and test will be executed.
NOTE: By default, the Android Studio will generate "debug" and "release" Build Types for your project. So, to change a Build Type, all you need to do is just select your Build Type from the Build Variant and after the project sync, you are good to go.
Documentation says (http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Android-tasks and http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Building-and-Tasks) that you can use the following commands to produce specific build types:
gradle assembleDebug
gradle assembleRelease
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With