Wednesday, October 18, 2017

Ionic 3 Build Android App - Create apk file which can be installed in an android device

Steps to create an apk file using ionic 3

Step1: Add Platform

$ ionic cordova add platform android

Step 2: Go to platforms/android

$ cd platforms/android

Note: Add the location of the bin folder of the JDK installation in the PATH Environment Variable

Step 3: Generate Keystore file 

$ keytool -genkey -v -keystore some_name.keystore -alias some_name-keyalg RSA -keysize 2048 -validity 10000

You should enter a password during the generation of some_name.keystore. Remember this passoword and keep some_name.keystore in a safe place.

Step 4: Open build.gradle file in platforms/android and search for the section signingConfigs. Make changes as shown below.

signingConfigs {
    release {
        // These must be set or Gradle will complain (even if they are overridden).
        keyAlias = "some_name"
        keyPassword = "your_password" // And these must be set to non-empty in order to have the signing step added to the task graph.
        storeFile = "some_name.keystore"
        storePassword = "your_password"
    }
}


Step 5: Go to your root folder of the project

$ cd ../../

Step 6: Build

$ ionic cordova build android --release

If successful you will get the following message
...
...
BUILD SUCCESSFUL

Total time: 45.593 secs
Built the following apk(s):
        path_root_folder/platforms/android/build/outputs/apk/android-release-unsigned.apk


Step 7: Sign the apk

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore platforms\android\some_name.keystore platforms\android\build\outputs\apk\android-release-unsigned.apk some_name

Note: Add the location of the Android sdk build tools folder in the PATH Environment Variable.

Step 8: Zipalign

$ zipalign -v 4 platforms\android\build\outputs\apk\android-release-unsigned.apk Some_Name.apk


You will find the generated apk file in the root folder of your project. Generated apk file is now ready to be installed in your android phone.


25 comments:

  1. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.

    ionic training in chennai

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. A few refreshed telephone accompanying Android stage. More than 500K android apps for more than 500 android gadgets have overflowed by android advertise.
    A few refreshed telephone accompanying Android stage. More than 500K android apps for more than 500 android gadgets have overflowed by android advertise.https://appcloner.app
    https://appcloner.net

    ReplyDelete
  4. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks auto reply text

    ReplyDelete
  5. Most of these applications are free. Some require you to upgrade by paying a small fee if you wish to get access to more advanced features. So what do you have to do to get files from the Market?
    app cloner

    ReplyDelete
  6. Cycling in Theth is something else!!! There is so much to see and to learn from Albania! Travel Albania

    ReplyDelete
  7. If you are looking for an inspirational walk than trekking in the trail of the old mills in Dhermi in Albania is a must-do. Albanian Cities

    ReplyDelete
  8. Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post! XE88

    ReplyDelete
  9. Usually, App development process comprises of many critical stages that require intense attention, greater care and precise knowledge.Mobile App

    ReplyDelete
  10. I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article. showboxapkfree

    ReplyDelete
  11. I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article. showboxapkfree

    ReplyDelete
  12. I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more. TubeMate APK Review

    ReplyDelete
  13. A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one. Tubidy Video APK Download Latest version Free

    ReplyDelete
  14. Android 3 Apps will make simple to create Android Apps according to the prerequisite.
    Bulk SMS Service Provider in Sharjah UAE

    ReplyDelete
  15. In such a case I prefer to relax with my tablet and watch a movie with the help of some special application.
    If you don't have such you can download it here https://ishowboxapk.com/ and try to enjoy your favorite TV show or movie.
    showbox Apk download/

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. blackmart apk xda _ APK For All

    ReplyDelete
  19. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. blackmart apk xda _ APK For All

    ReplyDelete
  20. Minecraft Apk indir and Minecraft Pe APK Free current version 1.14.20.1 : gratis There are so many games on the internet that one can spend whole life and yet cannot play all of them. However, there are only a few games that make their way to the top. Reaching the top means that these specific games come on top of the abyss of games present out there. Only graphics or cool soundtrack is helping to reach the top

    ReplyDelete
  21. The need for mobile app developers is thus increasing at a higher rate. The ace players in Smartphone market including Apple and Google are striving to attract app developers to their App Store by providing some relaxation in their regulations.Mobile App development

    ReplyDelete
  22. In addition to the fact that it is a telephone, yet it can serve as a convenient gaming gadget. The controls are fundamentally the same as Sony's different items,game mod for example, the PSP and the PS3 controller just to give some examples.

    ReplyDelete
  23. You can utilize the 'what you see is the thing that you get' (WYSIWYG) editorial manager to create site content.Wikipedia writers for hire

    ReplyDelete