Android Studio Custom Pack apk name

Source: Internet
Author: User

Android Studio Packaging App The default generated apk name is: app-release.apk, if we want to let the generated apk name with our version of the package name, then we will have to customize the generated apk name, how to do it.

We only need to add the Build.gradle (module:app) file under android{}:

1 Android.applicationVariants.all {variant-2         variant.outputs.each {output-3              New File (output.outputFile.parent, Defaultconfig.applicationid + "-" + Buildtype.name + "-V" +4< /c6>                     defaultconfig.versionname + "-" + Defaultconfig.versioncode + ". apk" ); 5         }6     }

This way we pack the APK name is: com.test.demo-release-v1.01-2.apk, automatically bring our package name and version number, save each time you have to manually change.

Android Studio Custom Pack apk name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.