-
Notifications
You must be signed in to change notification settings - Fork 465
Ionic Cordova Builds on Windows and CircleCI
For deploying the app on the mobile device on Windows OS you should do the following steps in the folder of the app.
- Prepare Gradle
-
Download Gradle v4.10.1 from https://downloads.gradle.org/distributions/gradle-4.10.1-all.zip, save ZIP file directly into C:\Gradle, so it will be like C:\Gradle\gradle-4.10.1-all.zip. Unpack Zip file into folder C:\Gradle\gradle-4.10.1.
-
Next, check following windows environment vars are set:
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)
- Install latest stable Ionic & Cordova:
npm install -g ionic
and
npm install -g cordova
- Make sure you have installed all packages with
yarn install
- Run following commands to reinstall required Cordova Android platform:
cordova plugin save
cordova platform rm android
cordova platform add android@7.1.4
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
- Run command:
ionic cordova build android
- 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
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:
- https://circleci.com/docs/2.0/language-android
- https://softwareontheroad.com/ionic-circleci2
- Android Docker images in Circle: https://hub.docker.com/r/circleci/android/tags/