Build and use of Android KeyStore

Source: Internet
Author: User

Android requires that all programs must have a signature, otherwise the program will not be installed. In our development process, ADT uses the debug KeyStore, which is set in Preference->android->buid. Debug KeyStore is valid for one year by default, and if you started developing Android programs a year ago, it is likely that the debug KeyStore expires and you cannot generate the APK file. I tuned the system time and the following error occurred. At this point you just delete the debug KeyStore, and the system will generate a private key that is valid for one year.

When you release, you can generate signed packages with right-click Project->android tools->export signed Android package. In this process, if you do not have your own private key, ADT will automatically call Keytool to generate it for you. Please protect your private key, otherwise you will be stolen, you use to attack your signature program.

Release should also note the version number, in Manifest.xml there are two fields android:versioncode= "1" and Android:versionname= "1.0", the former is for the program or Android use, to 1 increments. The latter is for users to see, where you can use the major version number of the minor version number of the build number light string.

First of all, we need a keystore, and of course we already have it.
CMD under:
Go to the Bin directory of the JDK, so that the Android.keystore file will be generated in this directory, we need this file when signing
C:/Program Files/java/jdk1.6.0_10/bin>keytool-genkey-alias android.keystore-keyalg rsa-validity 20000-keystore Android.keystore
Enter KeyStore Password:
Enter the new password again:
What is your first and last name?
[Unknown]:

What is the name of your organizational unit?
[Unknown]:
What is your organization's name?
[Unknown]:
What is the name of your city or region?
[Unknown]:
What is the name of your state or province?
[Unknown]:
What is the two-letter country code for this unit?
[Unknown]: 86
Cn=. , ou=. , o=. , l=. , st=. , c=86 correct?
[No]: Y
Enter <android.keystore> master password (if same as KeyStore password, press ENTER):

Where the parameter-validity is valid for the certificate number of days, here we write 10,000 days larger. There is no echo when you enter the password (even if you lose it) and backspace, tab and so on are the password content, this password is required for the. apk file signature.

Then sign:
In Eclipse, right-click the project that needs to be signed-->android Tools-->export signed application package ...
The following dialog box appears, selecting the project to be signed

Next, select the Android.keystore file location and password that you created above

Next

Next, select the location and name of the signature generation file

Finish, it's done.

Build and use of Android KeyStore

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.