Thursday, August 27, 2015

Sign Releases with Cordova Android - Cordova 5

The Cordova CLI for Cordova 5 Phonegap  tutorial

Introduction: Adobe PhoneGap© says that it takes the pain off developing mobile apps! Android developers seemed to take heed of that as well as ios developers. And windows mobile app makers too. The biggies on deciding how to make an app have chosen Phonegap as the app creator. But the constant software development and revisions take a heavy toll on developers time and on documentation! 
As iLee.co.uk does not revise what is to be done for Gradle and Cordova 5, here it is for our developer colleagues revised as on 28 August 2015
Since the Cordova 5 was introduced about a few months ago, building and deploying Cordova apps for development has become different to say the least. E.g. for Android:






$ cordova build android









$ cordova run android


As before if you want to build a release version of an APK from the command line for production. Use command below however, this does not sign your release:





$ cordova build android --release


 To release a signed apk to Android with Cordova 5, first a keystore file must be created as usual.

$ keytool -genkey -v -keystore <"Name of Application">.keystore -alias <"Your Alias"> -keyalg RSA -keysize 2048 -validity 10000


Enter the keystore password and continue entering in all the rest of the prompted information
Copy this newly created key store created whichever folder you are in, into the platform/android directory.

Release in CLI workflow

Use this below to hooks directly into the cordova build android --release command.
Cordova 5 (might have been 4 as well) uses Gradle to compile now, so the old ant.properties no longer works. 
You can work the same trick by creating a release-signing.properties file in platforms/android and adding the following fill with your file name and other information:
storeFile=
storeType=jks
keyAlias=
// optional :
keyPassword=
storePassword=
Also It works with Java 7 no issues, no certificate signing issues. 
And finally give the command 
cordova build android --release 

and you get a signed zip aligned apk to be sent to the Google play store. 

Its is found in /platforms/android/build/outputs/apk/ folder

Happy developing!
Thanks Adobe and Apache Cordova





Get more value from your mobile app strategy


Develop Cross Platform Mobile apps.Call us



20 comments:

  1. Great information. Thanks for providing us such a useful information. Keep up the good work and continue providing us more quality information from time to time. Android Development

    ReplyDelete
  2. A magnificent post this. I really love the way you've presented the writing in this blog. It's very lovely and I hope you keep this quality of your work going. Mobile App Maker in Mumbai || Mobile App Maker Company in Mumbai || App Developers in Mumbai || Mobile App Developers in Mumbai || Mobile App Development Companies in Mumbai || Mobile Application Development Companies in Mumbai

    ReplyDelete
  3. Thanks for sharing this helpful article,
    radio app builder

    ReplyDelete
  4. It's perfect article about mobile app development,.

    desarrollo de aplicaciones moviles

    ReplyDelete
  5. Thank you so much for this nice post,.
    android developer

    ReplyDelete
  6. Thank you for posting useful information.To get best Blackberry app development services visit
    Black berry development company

    ReplyDelete
  7. This blog has tempted me and now it seems that I must visit all the time this web page.
    OS

    ReplyDelete
  8. I am satisfied that you simply shared this useful information with us.
    game app developers

    ReplyDelete
  9. Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.
    ios app development company

    ReplyDelete
  10. I wish to have some more blogs about the lastest android development,.
    android nougat news

    ReplyDelete
  11. really nice article !!! I had learned so many things reading this article, thanks a lot for sharing the information. Our site also provides an innovative and interactive Mobile App Services and if you want more ideas to refer our site: www.hvantagetechnologies.com

    ReplyDelete
  12. Thanks for the post, you have provided a simple step by step process so anyone can understand easily. For understanding Mobile Application Services and Android Development, you can visit Yberry Infosystem in Indore Visit: www.yberryinfosystem.com

    ReplyDelete
  13. Thanks for sharing with us it was a nice and very helpful blog .
    Application design and development USA

    ReplyDelete
  14. These ways are very simple and very much useful, as a beginner level these helped me a lot thanks fore sharing these kinds of useful and knowledgeable information.
    Android App Development Company

    ReplyDelete
  15. I just want to say that all the information you have given here is awesome...great and nice blog thanks sharing..Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...
    Web Design Development Company
    Web design Company in Chennai
    Web development Company in Chennai

    ReplyDelete