Android > Phone Gap >> Work with Phonegap Views : 9101
Rate This Article :

Signing APK file using jarsigner

Signing APK file is important to publish your application into App Store. This article will explain how to sign APK file using Key file.

1. Run “GIT CMD” Prompt

2. Go to “C:\Program Files\Java\jdk1.7.0_151\bin” and make sure “jarsigner.exe” is present in the path

3. Execute the below command. Make sure the “android-release-unsigned.apk” and “Key file” is present in the given path.

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore D:\MyApp.keystore -storepass StorePass -keypass KeyPass D:\Myapp.apk MyApp

4. Verify APK is properly signed using below command.

jarsigner -verify -verbose -certs D:\Myapp.apk

5. After successful signing, execute the below step to zip align the apk file.

6. Navigate to build tools folder “C:\Program Files\Android\android-sdk\build-tools\23.0.0” and execute the “zipalign” exe by running the below command.

zipalign -v 4 D:\Myapp.apk D:\Myapp-Signed.apk

7. Above command will align all the files inside APK to generating the “Signed” (name given) APK.

Now APK is properly signed and aligned to use. Read this article to know how to create "KeyStore" file.

About Author
Raj Kumar
Total Posts 57
Developer in .Net!
Comment this article
Name*
Email Address* (Will not be shown on this website.)
Comments*
Enter Image Text*
   
View All Comments
Rajkumar
@steve buonincontri, Changed the Title as per the Context. It is not related to CORDOVA CLI.
steve buonincontri
what does this article have to do with cordova CLI? any way for cordova build --release to use a config file to do this under cover?
  Privacy   Terms Of Use   Contact Us
© 2016 Developerin.Net. All rights reserved.
Trademarks and Article Images mentioned in this site may belongs to Microsoft and other respective trademark owners.
Articles, Tutorials and all other content offered here is for educational purpose only and its author copyrights.