Note: To our own development of the app signature, it represents my own copyright, in the future to upgrade, you must use the same signature. The signature represents your identity (that is, keystore), and multiple apps can use the same signature.
If you do not know what the signature is, please own Baidu Oh. The way to sign in Eclipse is: Select project, mail Select "Export-android-export android Application",
1. Mode 1: Sign through Android Studio:
Select the app module and choose the menu bar "Build-generate signed apk":
The following screen appears:
, if you are using your signature for the first time, click the Red Box section to create a new signature, or if you have previously signed a file, select the Blue box section to import it. Then I'll select the red-framed part first:
, after clicking "Finish", you can see the bottom of Android Studio: Gradle is performing assemblerelease such a task as shown in:
After generating the signed apk, a prompt will appear:
2, Mode 2: Signed by the command line:
(1) Load key Store:
Let's first delete the APK file signed by the first method. Next, proceed to the second way to sign the command line.
Open the Project Stucture graphical interface:
, select the app module, then switch to the Singning tab bar, then click Add, then generate the release signature information, followed by click "OK". Then do the following:
, switch to the Build Types tab and select signing config as "release" to configure the release signature information that was just generated.
After the operation is complete, we can see that the Build.gradle file of the app module has the following code in the Red-box section:
Then execute "Build-clean Project" on the menu bar:
(2) Generate Realease version of APK:
Immediately after the command line terminal enter the following command: (as has the command line terminal integrated into the software)
gradlew assembleRelease
If the operation succeeds, the effect is as follows:
The generated signature good apk is in the following location:
Two ways to learn---signature packaging in Android studio