Skip to content

Ionic Cordova Builds on Windows and CircleCI

Ruslan Konviser edited this page Jul 27, 2019 · 1 revision

Windows Builds

For deploying the app on the mobile device on Windows OS you should do the following steps in the folder of the app.

  1. Prepare Gradle
ANDROID_HOME (sample value: "F:\android-sdk")
JAVA_HOME (sample value: "C:\Program Files\Java\jdk1.8.0_172")
CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL (sample value "file:/C:/Gradle/gradle-4.10.1-all.zip")
GRADLE_HOME (sample value: "C:\Gradle\gradle-4.10.1")
GRADLE_USER_HOME (sample value: "C:\Gradle\gradle-4.10.1")

IMPORTANT: do NOT forgot to run new command line to make sure changes to env vars got into effect! (if you change anything of course)

  1. Install latest stable Ionic & Cordova:
npm install -g ionic

and

npm install -g cordova
  1. Make sure you have installed all packages with
yarn install
  1. Run following commands to reinstall required Cordova Android platform:
cordova plugin save
cordova platform rm android
cordova platform add [email protected]

An alternative to commands above would be to try to run following (works if you already have latest Android Platform installed locally):

ionic cordova prepare

This should install all plugins listed in config.xml

  1. Run command:
ionic cordova build android
  1. Run command:
ionic cordova run android 

OR

ionic cordova run android --device

NOTE: make sure your device is connected to the computer with USB also, ensure that Developer mode is enabled on your Android device and USB Debugging is activated.

This is a link for more information: https://medium.com/@coderonfleek/debugging-an-ionic-android-app-using-chrome-dev-tools-6e139b79e8d2

CircleCI Cordova Android APK Builds

We are building Android APKs for Mobile Shop, Carrier and Merchant apps on CircleCI (currently in Debug mode) and publish artifacts and they can be download from Circle using links like https://circleci.com/gh/ever-co/ever/17106#artifacts/containers/0 (where 17106 is CircleCI build number, use latest build number to get latest APKs)

See the following links for how CircleCI configured: