Skip to content

Ionic2 Starter template and Deploy steps, Generate .apk file for android

Notifications You must be signed in to change notification settings

venkatch668/ionic2-Starter-template_DeployementSteps

Repository files navigation

This is a starter template for Ionicprojects.

How to use this template

*Download the files https://github.com/venkatch668/ionic2.git

With the Ionic CLI:

Take the name after ionic2-, and that is the name of the template to be used when using the ionic start command below:

$ npm install -g ionic cordova
$ ionic start myTabs tabs

Then, to run it, cd into myTabs and run:

$ ionic cordova platform ios or $ ionic cordova platform andorid
$ ionic cordova run ios or $ ionic cordova run andorid

Ionic Setup & Deploy

  1. Install Ionic and coredova files

    Command : npm install -g cordova ionic

    Ref: https://ionicframework.com/getting-started/

  2. Develop your own login / application as per requirement

  3. Install Latest Android SDK(2.3), Java Latest version (1.8)

    Ref: https://developer.android.com/studio/index.html

    Ref: https://www.java.com/en/download/windows-64bit.jsp

    Set proper environment variables

    1. JAVA_HOME

    2. Path

  4. Get Setup/build ready

    Command: ionic cordova run android --prod –release

    Then it will create unsigned .apk file in below path

    Path: myApp\platforms\android\build\outputs\apk

    But to install in device we need signed .apk

  5. Sign Android APK

    Command: keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias

    Enter password: demoadmin123 & re-enter again (Note: we can use any password, we should use same password in whole app)

    Command: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks android-release-unsigned.apk my-alias

    Enter password: demoadmin123

    Ref: https://ionicframework.com/docs/intro/deploying/

Now Signed .apk file is ready, copy into mobile then install.

<p><b>Additional Points:</b></p>
1.	Need 5 hours of time to setup
2.	Good internet speed
3.	Careful on setup javapath

@venkat