Android Studio Gradle Automatic signature Build implementation

Source: Internet
Author: User

First, create a signature file in Android Studio.

1. Select the project in Android Studio and choose Build in the menu bar.

  

2. Click the Generate Signed APK tab.

  

3. Copy the generated JKS files to the project file, as in my project structure directory.

  

Second, in the build file to add their own signature of relevant information.

  

Signingconfigs {        myconfig {            storefile file ("**.jks            ")            "* *" "* * "             "* *"//Replace the "* *" here with your own information         }    }    buildtypes {        release {            signingconfig  signingconfigs.myconfig//don't forget to include me in the release. The signature configuration information             false            proguardfiles Getdefaultproguardfile (' proguard-android.txt '), ' Proguard-rules.pro '        }    }

In this case, we have configured, how we can complete our signature building there are two methods.

Third, the use of Gradle to complete the app signature construction.

1, using Android Studio for our built-in good gradle command. In the Android Studio development tool we found the Gradle tab:

    

The command to mark with a red line is the one we signed and packaged. We just double click with the mouse and the command starts to execute:

   

When we saw build successful, we were able to build. Next we look at our apk file generation.

The signature was successful!

2, we also have a way to knock orders. Open the Terminal tab. When we open it, we'll knock. Gradle--help command to verify that the Gradle command can be executed. If not, inside the environment variable

Configure the path of the Gradle.

  

Gradle Assemblerelease

  

  

Android Studio Gradle Automatic signature Build implementation

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.