Game Development Reference
In-Depth Information
Run this command:
zipalign -v 4 MyFirstApp.apk ReadyMyFirstApp.apk
You have successfully signed the “MyFirstApp” Android app and the file ReadyMyFirstApp.apk
can be now installed in your device.
If you wish, you can create a windows batch script to sign an APK manually, as shown
in Listing 10-1.
Listing 10-1. Windows Batch Script to Sign the MyFirstApp Application Package (APK)
@echo off
rem Location of your JAVA SDK
set JAVA_HOME= C:\Program Files\Java\jdk1.8.0_20
rem Location of the APK to sign
set PKG= C:\Users\nardone\workspaceA\MyFirstApp\bin\MyFirstApp.apk
rem Sign it
"%JAVA_HOME%\bin\jarsigner" -verbose -keystore ar-release-key.keystore %PKG% android_radio
rem To verify that your .apk is signed, you can use a command like this
"%JAVA_HOME%\bin\jarsigner" -verbose -verify %PKG%
You may have to edit Listing 10-1 to set up the location of your Java SDK plus the location
of the Android APK to sign.
Signing Your APK Visually
With Android SDK 1.5 or later, signing your package is much easier, provided you already
have a key store; you don't need the jarsigner command in this instance. To sign the
MyFirstApp project's package with the Android Studio, follow these steps:
1.
Go into the Build menu and select Generate Signed APK
(see Figure 10-3 ).
 
Search WWH ::




Custom Search