Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,374 members, 7,800,747 topics. Date: Thursday, 18 April 2024 at 05:28 AM

IONIC 3 Cordova Build Android Apk Without Android Studio Install - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / IONIC 3 Cordova Build Android Apk Without Android Studio Install (2667 Views)

Cordova Install Challenge / Build Android And IOS App With Python. / Pls Help : How To Install Cordova On Windows 7 (2) (3) (4)

(1) (Reply) (Go Down)

IONIC 3 Cordova Build Android Apk Without Android Studio Install by project7(m): 6:11pm On Apr 09, 2018
BUILD APK - stay connected to the internet
------------

download
android sdk tools UNZIP into C:\Android\android-sdk-windows\
platform tools UNZIP into C:\Android\android-sdk-windows\
gradle-4.6-all.zip UNZIP into C:\Gradle\

set environmental variables
ANDROID_HOME = C:\Android\android-sdk-windows
GRADLE_USER_HOME = C:\Gradle
CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL = file:///C:/path-to-gradle-file/gradle-4.6-all.zip

OR in GradleBuild.js and StudioBuild.js set
var distributionUrl = 'file:///C:/path-to-gradle-file/gradle-4.6-all.zip';

set path
C:\Gradle\gradle-4.6\bin;
C:\Android\android-sdk-windows\tools;
C:\Android\android-sdk-windows\platform-tools;

install platform tools if missing
C:\Android\android-sdk-windows\tools\bin/sdkmanager.bat "platform-tools" "platforms;android-26"

install build tools
C:\Android\android-sdk-windows\tools\bin\sdkmanager.bat --list
C:\Android\android-sdk-windows\tools\bin\sdkmanager.bat "build-tools;27.0.3"

accept all licenses
C:\Android\android-sdk-windows\tools\sdkmanager.bat --licenses

platforms/android/gradle/gradle-wrapper.properties
distributionUrl=file:///C:/path-to-gradle-file/gradle-4.6-all.zip

commands
cordova platforms add android
cordova platforms remove android
ionic cordova build --release android

apk location
C:\<path-to-app>\platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk


SIGN APK
-----------

1) set path C:\Program Files\Java\jdk1.8.0_121\bin\ <------------path to jdk

2) Let’s generate your private key using the keytool command that comes with the JDK:

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

3) To sign the unsigned APK, run the jarsigner tool which is also included in the JDK:

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

4) we need to run the zip align tool to optimize the APK. The zipalign tool can be found in /path/to/Android/sdk/build-tools/VERSION/zipalign.

zipalign -v 4 app-release-unsigned.apk test.apk
*C:\Android\android-sdk-windows\build-tools\27.0.3\zipalign -v 4 app-release-unsigned.apk test.apk

5) To verify that your apk is signed run apksigner. The apksigner can be also found in the same path as the zipalign tool:

apksigner verify test.apk
*C:\Android\android-sdk-windows\build-tools\27.0.3\apksigner verify test.apk

1 Like

Re: IONIC 3 Cordova Build Android Apk Without Android Studio Install by CharlotteThomas: 8:22pm On Jun 17, 2018
This very interesting news to a tech person like me, how this gentleman has build Android APK with android studio installed in that device. I was confused first and when I tried running on australianwritings.com reviews blog server the same code which was shared in this post, it really worked smooth and all the features are working

(1) (Reply)

Insert Image Into Mysql / Tutorials For Mobile App Development / How To Make Youtube Shorts | Youtube Shorts Beta

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.