Game Development Reference
In-Depth Information
Note
Android developers, more information about signing your applications is available at
We'll show you first how to sign using the release mode. As first step, you need to create a
key store. Let's start.
Creating a Key Store
A key store is a password-protected file that contains public/private key pairs used for JAR
signatures. You can create a key store with the following command:
$ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA
-validity 10000 -storepass <password1> -keypass <password2>
Table
10-1
lists the possible arguments for the
keytool
command.
Table 10-1.
Arguments for the keytool Command
Argument
Description
-genkey
Generate a public and private key pair.
-v
Use verbose output.
-keystore
Specify the name of the key store.
-alias <alias_name>
Add an alias for the key pair.
-validity <valdays>
Specify the validity period in days.
-storepass <password>
Add a password for the key store.
-keypass <password>
Add a password for the key.
Tip
When you run your applications in the emulator, Android Studio will automatically sign
the application using a debug key stored in
%USERPROFILE%\.android\debug.keystore
(in Windows) and
$HOME/.android/debug.keystore
(in Linux). Notice also that
the debug key stored password is
"android"
and the key alias and password are
androiddebugkey/android
.