Android How to modify the default name of APK
The name generated when packaging the App with Android Studio defaults to app-release.apk (signed) or app-debug.apk (test version).
If you want to change the default name when packaging, you can open the build.gradle (module: app) file and add the following code in android{}:
android.applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith('.apk')) { //这里修改apk文件名 def fileName = outputFile.name.replace("app", "你想要的名字") output.outputFile = new File(outputFile.parent, fileName) } } }
Write Simply click BuildApk in the Build toolbar or use signature packaging.
The rendering is as follows:
In fact, it can also be like this: right click -> Rename.
Thank you for reading, I hope it can help you, thank you for your support of this site!
For more Android related articles on how to change the default name of APK, please pay attention to the PHP Chinese website!