Skip to main content

Signing apk from ionic

This post will show you how to sign your apk manually, from ionic framework for release.
Recently I signed my first apk from ionic and ran into some issues that will be ironed out in this blog.

1. You will need to have the sdk and jdk / jdr tools installed.
2. Have a ionic project with the Android platform installed.

LETS START

You need to build your app using below in the cmd line then move that project-release.apk file into this directory

 ionic build android --release

exampleApp\platforms\android

MAKING THE KEYSTORE

You then need to make the key store in that file and write in all the info. Do not lose the key file and keep a record of the information.
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

SIGN THE APK

Now we have to sign the apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name
now it is signed.

ZIPPING UP

Now zip up the files to create a project.apk find Zip align tool found here(Program Files (x86)\Android\android-sdk\build-tools\21.1.2) might be different for you put it into exampleApp\platforms\android. Then write this in the cli

zipalign -v 4 HelloWorld-release-unsigned.apk HelloWorld.apk

You are finished and now should have a exampleApp.apk file in the platforms android folder

TROUBLE SHOOTING

Some of the cli cmds may not work and for this you need to change your path in
computer>advanced settings> environment variables
 and then find path and add a new and type in the directory path for your key-tool etc this tells the cmd line where to find the exc files etc.

GIT of files I used for this tutorial here


OTHER WAYS

There is other ways of signing apks and here is a list of a few good links. Bear in mind some of these might be old and to find solutions you have to look in the comments.

tutorial by Nic Raboy 




Comments

Anonymous said…
Thank you for sharing this useful information. Nice Post.

Ionic Training in Chennai | Ionic Course in Chennai

Popular posts from this blog

Ionic RSS feed using Feednami

Tutorial of how to make a RSS feed using Feednami which is an alternative to google api which no longer works. This is a basic example and can be improved. First go ahead and make a new ionic project $ npm install -g cordova ionic $ ionic start exampleProject blank Now find index.html and insert... <script src="https://storage.googleapis.com/feednami-static /js/feednami-client-v1.0.1.js"></script> Into the header, then in <ion-content> below Ionic Blank Starter insert a new div <div id ="feed" ng-controller="feedCtrl"> </div> Open app.js, now we are going to make the controller from Feednami that will get our rss feed. .controller('feedCntl', function(){ var url = 'http://daringfireball.net/feeds/articles' feednami.load(url,function(result){ if(result.error){ console.log(result.error) } else{ var entries = result.feed.entries for(var i = 0; i < entri...

Google daydream and all its awesomeness.

Google Daydream  At Google io in 2016,  Google announced: Google daydream. A platform that can bring VR to everyone throughout the use of mobile phones and their new viewer. I was so inspired watching this I felt a need to make Daydream content. However to be able to develop this you need a Google view (£69 from Google store) and a daydream ready phone (£599 and up from Google store). I still plan to do this and will be buying a red viewer very soon (Im so excited XD) and will do an unboxing so look out for that! Then I will be saving up for the pixel phone (which is beautiful) and then onward with making awesomeness. Developing awesomeness  Its not just awesome because of the new viewer and the new pixel phone but the amount of help from google for developers is amazing they already have SDK kits for Android, Unity and Unreal. Unity and Unreal and two powerful game engines both have pros and cons but both are great for making games. I have experie...

BBC micro bit go un-boxing

The BBC micro bit  A while ago I attended Hacksoton  which is a hack day in Southampton, UK. It was a great day and I got to see and hear new and interesting technology (I would recommend for children and developers in the area). One of these technologies was the BBC Micro bit  . What is it for?  Its designed to get children into coding, you can use python, javascript or block editors. I loved them so much that I decided to get myself one as it can also be used with raspberry pi. So below is a video of me opening my micro bit go and I hope to do many exciting projects in the upcoming year and will be writing up about them so keep an eye out! What would you like to see with the micro bit? let me know in the comments below.