DEV Community

Cover image for Custom APK output filename from Android Studio (gradle)
Egit S.
Egit S.

Posted on • Originally published at esabook.wordpress.com on

Custom APK output filename from Android Studio (gradle)


Capture


Change those standard’s default-output-build-name to as your keyword.

Official document https://developer.android.com/studio/build/configure-apk-splits.

android {
...
applicationVariants.all {
        variant ->
             variant.outputs.each {
                  output ->
                       output.outputFileName = "${defaultConfig.applicationId}-v${defaultConfig.versionName}_${variant.flavorName}_${defaultConfig.versionCode}_${new Date().format('yyyy-MM-dd_HH.mm.ss')}.apk"
             }
...
}

Discussion (0)