Search code examples
androidandroid-studioapkandroid-gradle-pluginbuild.gradle

Change generated apk name from "app-debug.apk"


Every time I run a project with Android Studio (1.02) it's generate an unsigned apk which located in ..\build\outputs\apk folder and get by default the name "app-debug.apk"

I want to change that default name to something else.

Is it possible? How?


Solution

  • You can use applicationVariants and change the output file in the build.gradle. You can also modify the name regarding to your needs.

    buildTypes{
    
        applicationVariants.all { variant ->                              
            variant.outputs.each { output ->                              
                output.outputFile = file("$project.buildDir/apk/test.apk")
            }                                                             
        }
    
    }