Original solution sacrifices new api lint check.
Here my solution:
int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "lt.neworld.minsdktest"
minSdkVersion minSdk
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
}
And just need to pass minSdk
with preferred API version.
I am using most recent that my device support.
CLI:
./gradlew installDebug -PminSdk=23
IDE:
This solution saves me at least 40 seconds for every build, and new API lint check still works: