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

4 2

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"
             }
...
}

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay