Teach you how to use Android Studio to release release version "Go"

Source: Internet
Author: User

Original link

There are people who must be mad about how to release the release version of the app in Android Studio (AS). are experienced, I understand this mood, Baidu to the basic is semi-finished, why so say? Baidu a bit, you know, well, no nonsense, the following is a complete tutorial.

First, the premise

Release release version, first of all, the need to ensure that the current app does not have bugs, can be officially released, hey, that's it ~ ~

Two. Prepare JKs

. JKs is a keystore, a binary file that contains one or more private keys, just remember that he is as important as a human fingerprint. Remember! The same certificate must be used throughout the lifetime of the app so that users can install the new version as an app update. Let's take a look at how to create a keystore in as.
First, in the menu bar, click Build > Generate signed APK. The following dialog box appears


Click Create New .... If there is a direct choose good.
clicking will let you create a keystore, such as

a little explanation of the above picture
Key
Store
Key Store Path: Select the location to create the KeyStore + keystore name +jks.
Password: Create and confirm a secure password for your keystore.
secret key
Alias: Enter an identity name for your key.
Password: Create and confirm a secure password for your key. This password should be different from the password you selected for the KeyStore
Validity (years): Sets the effective duration of the key in years. The key should be valid for at least 25, so that you can use the same key to sign app updates throughout the lifetime of your app. Default is 25
Certificate: Enter some information about yourself for the certificate. This information is not displayed in the app, but is included in your certificate as part of the APK.
must be two password to remember, must be two password to remember, must be two password to remember points, important things said three times, I for simple, two passwords are consistent, but for security reasons, it is best not the same. Fill out, click OK, this time will be in the corresponding file generated Demo.jks (my), and then back to the following interface, click Next-->finish


Third, configure the build process to automatically sign your APK

1. In the Project window, right-click your app and click Open Module Settings.
2. Under Modules in the left panel of the Project Structure window, click the module you want to sign.
3. Click on the Signing tab and click ' + '.
4. Select your KeyStore file, enter a name for this signing configuration (optionally one), and enter the required information.



, locate the KeyStore created above, enter the KeyStore password,
and the key password


Then, click the Build Types tab, click Release Build, and under Signing Config, select the signing configuration you just created. Click OK


now, every time you build a release build using Android Studio, the IDE automatically signs the APK with the signing configuration you specify.

Iv. Release Release version

Smooth completion of the above steps, then released release release is a key, first, modify the release version, in the lower left corner of AS, modify the build variant to release, then, run, this time under the project App\build\outputs\ The release version of the APK will be visible under APK, good lucky~~


Five, signing notes

you should sign all APK with the same certificate during the expected lifetime of your app. There are several reasons for doing this:
Application Upgrade:
When the
system installs an app update, it compares the new version and the certificate in the existing version. If the certificate matches, the system allows updates. If you sign a new version with a different certificate, you must assign another package name to the app-in which case the user installs the new version as a new app.
Application modularity:
Android allows multiple APK signatures with the same certificate to run in the same process (if the app requests this) so that the system treats them as a single app. In this way, you can deploy your app in a module, and users can update each module independently.
Share code/Data with permissions:

Android provides signature-based permission execution so that the app can show functionality to another app that is signed with the specified certificate. By signing multiple APK with the same certificate and using the signature-based permission check feature, your app can share code and data in a secure way.

Teach you how to use Android Studio to release release version "Go"

Related Article

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.