Game Development Reference
In-Depth Information
Signing the Application
You have two choices when signing your application: manually, using the Java SDK
jarsigner command; or visually, using Android Studio.
Signing Your APK Manually
Note Sometimes it may be desirable to sign your app manually, especially if you have an
automated build system with no human interaction.
Let's suppose you want to sign a project named “MyFirstApp,” which is located in the
following directory:
C:\Users\nardone\workspaceA\MyFirstApp
Since you need to sign this project's APK file you'll locate it in the following directory:
C:\Users\nardone\workspaceA\MyFirstApp\bin\MyFirstApp.apk
To manually sign the APK file, you use the Java SDK jarsigner command and the key store
created in the previous section to sign the packed application as follows:
jarsigner -verbose -keystore <KEYSTORE-FILE> MyFirstApp.apk <KEYSTORE-ALIAS>
The arguments are as follows:
-verbose displays information about the files being signed.
-keystore defines the location of the Java key store created in the
previous section.
MyFirstApp.apk is the application package to sign.
KEYSTORE-ALIAS is the alias that represents the public/private key pair
used for signature created in the previous section.
As a bonus, you can verify the signatures are correct by using
the command
jarsigner -verbose -verify <PATH-TO-THE-APK>
Caution The keytool and jarsigner commands are part of the Java SDK, not the JRE. You will
have to install a Java SDK and set up the paths in your system to be able to create a key store and
sign your applications with jarsigner .
 
 
Search WWH ::




Custom Search