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.


10 comments:

  1. This comment has been removed by the author.

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

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

    ReplyDelete
  4. When we talk about internet marketing we all automatically think about generating a website, or blogging, or creating a Facebook and Twitter presence, and so. However for some reason YouTube never seems to feature that strongly in our internet marketing plans. Album Download

    ReplyDelete
  5. TAXPRO is a chief expert administration firm enhancing the matter of its customers for over 30 decades. We do this by giving a wide array of administrations in the monetary space which ranges from Entry Level Strategy, Taxation consultancy administrations, GST, Audit and Assurance, Accounting, Corporate Compliance, Payroll Services, ESI/PF Consultancy, and part more. We are a group of expense experts that incorporates Chartered Accountants, Advocates, Company Secretaries, Financial counselors offering marketing an accounting firm to the makers, Traders, Dealers, and specialist organizations of the business. Our administrations are looked for different business, lawful, and tax assessment confusions.

    ReplyDelete
  6. Android apps are applications that have been typically devised with the Java programming language, in collaboration with the Android Software Development Kit. However, there are other development kits such as Android NDK or indigenous tools for extensions or apps in C/C++. There is a visual setting which is known as Google App Inventor which the beginners and trainee developers use. Genuine app for Sweatcoin

    ReplyDelete
  7. Take care when choosing colors for your interior-design project. You want a color scheme the works harmoniously together to create a balanced look. It is just as important to avoid incorporating too many colors that clash with each other as it is to avoid creating a bland, monotone and boring space. To décor your house with gypsum hire JK Gypsum Decoration. They are the Gypsum Design company Dhaka.

    ReplyDelete
  8. Take advantage of the wind. The cleanest source of alternative energy is wind energy. It can even cut your electric bill by up to 90 percent. You can run an energy audit before you determine what size turbine you'll need, but most houses require 5 to 15 kilowatts to produce 780 kilowatt-hours per month. month. To get better solutions hire an environmental consultancy firm BD.

    ReplyDelete