Is it possible to specify the filename of the generated *.apk through gradle? So that I automatically could get MyApp-1.0.0.apk
instead of the default app-release.apk
.
You can do this by adding the following line to your build.gradle
file inside the android{...}
part:
android.applicationVariants.all { variant ->
variant.outputFile = file("$project.buildDir/${defaultConfig.versionName}-${defaultConfig.versionCode}.apk")
}
Notes:
file(...)
is arbitrary, of courseproject/module/build
directory, no matter what path you've specified when Building the Signed APK.build.gradle
file.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