Android Studio Build.gradle Configuration, use the official version signature in debug mode, rename apk

Source: Internet
Author: User

In the Build.gradle file, configure it under the Android node.

Android {compilesdkversion buildtoolsversion ' 22.0.1 ' signingconfigs {release {keyalias ' xxx ' Keypassword ' xxxxxxxxxxxx ' storefile file ('./xxx.keystore ') Storepassword ' xxxxxxxxx xxxxxxx '} config {keyalias ' xxxx ' keypassword ' xxxxxxx ' StoreFile file ('.        /xxx.keystore ') Storepassword ' xxxxxxxx '}} defaultconfig {ApplicationID "com.xxx.xxxxx" Minsdkversion targetsdkversion versioncode 7 versionname "2.2.1" Signingconfig si Gningconfigs.release}//Configure debug mode, use the official version of the signature, this operation is mainly for the convenience of debugging, Sina and other third-party login authorization Buildtypes {release {minif yenabled true Proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' Proguard-rules.pro ' Deb uggable true Signingconfig signingconfigs.release} debug {signingconfig signingconfi Gs.release}}    Channel Productflavors {baidu {manifestplaceholders = [umeng_channel_value: "Baidu"]} qihu360 {manifestplaceholders = [umeng_channel_value: "qihu360"]} Tencent {Manif Estplaceholders = [Umeng_channel_value: "Tencent"]}} sourcesets {main {java.srcdirs = [' src/main/j        Ava ', ' src/main/java/jnilibs ', ' Src/main/jnilibs '}}//Modify the generated apk name Applicationvariants.all {variant- Variant.outputs.each {OUTPUT, def oldFile = Output.outputfile if (variant.buildType.name.equ ALS (' release ')) {def releaseapkname = ' Pintuan_ ' + variant.productflavors[0].name + ' _release_ ' + DEFAULTC        Onfig.versionname + '. apk ' output.outputfile = new File (oldfile.parent, Releaseapkname)} }    }}


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android Studio Build.gradle Configuration, use the official version signature in debug mode, rename apk

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.