Android Studio own definition pack apk name

Source: Internet
Author: User

Android Studio Packaging App The default generated apk name is: app-release.apk, suppose we want to let the generated apk name with our version number package name. So we're going to define the generated apk name ourselves, what do we do?

We just need to build.gradle the file under android{} to add:

   Android.applicationVariants.all {variant-        Variant.outputs.each {output,            output.outputfile = new File (output.outputFile.parent, Defaultconfig.applicationid + "-" + Buildtype.name + "-V" +                    Defaultconfig.versionname + "-" + Defaultconfig.versioncode + ". apk");        }    }



So we pack the APK name is: com.test.demo-release-v1.01-2.apk, we take the initiative to bring our package name and version, save each time to manually change their own.


Android Studio own definition 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.