Skip to content

Build App

Iosif Miclaus edited this page Feb 6, 2017 · 3 revisions

Build

iOS

In order to build the project for iOS, you only have to run the following script:

sh build_ios.sh

This will do a few things for you:

  1. Run production build gulp task: gulp build
  2. Copy files for Cordova iOS: python cordova_prepare_ios.py
  3. Create iOS build: cordova build ios
  4. Open Xcode so that you may press Play

Prepare iOS

python cordova_prepare_ios.py;

Note: Tested w/ Python 2.7.9

The python script does the following:

  1. Empties the cordova/platforms/ios/www folder
  2. Copies necessary files from public to cordova/platforms/ios/www and ignores redundant files and folders
  3. Copies everything from cordova/platforms/ios/platform_www/plugins to cordova/platforms/ios/www/plugins
  4. Copies cordova/platforms/ios/platform_www/cordova.js to cordova/platforms/ios/www
  5. Copies cordova/platforms/ios/platform_www/cordova_plugins.js to cordova/platforms/ios/www

Note: This may change in the future !


Android

In order to build the project for Android, the following python script has to be executed:

python cordova_prepare_android.py

Note: Tested w/ Python 2.7.12

The script copies all necessary files into cordova/www and not into the platforms folder. The files need to be located there as the default index.html and .js files are replaced with the content of this folder, upon building the platform.

After the script completed, the following steps must be made in order to build the final .apk:

NOTE: Windows used for building

  1. Navigate to the project folder of the whole project, in the command line. In this case mobilot and there to cordova/plattforms/android.
  2. In this folder execute the following command cordova build --release android. This will create an unsigned .apk file.
  3. Take the .apk file and place it at the same spot where the Mobilot.keystore is located. (The password is “mobilot” and the alias “Mobilot”).
  4. Change the location of the command line to the place with the .apk and .keystore. There execute the following command jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore Mobilot.keystore android-release-unsigned.apk Mobilot.
  5. Verify that the .apk is signed by executing the following command jarsigner -verify -verbose -certs android-release-unsigned.apk.
  6. Align the application in order to reduce the amount of RAM usage it has. To do this execute the following command zipalign -v 4 android-release-unsigned.apk Mobilot.apk. (zipaling is part of the Android SDK)

FINALLY Execute: adb install Mobilot.apk, with a connected device, in order to install the application.

Clone this wiki locally