Skip to content

Generate mobile distribution files

Harel M edited this page Jan 17, 2019 · 11 revisions

Android

In order to generate android apk file the following steps should be taken:

  • Install android studio - described here
  • [Optional] npm install cordova -g - this will install cordova cli tools globally to allow developing stuff related to cordova.
  • Go to IsraelHiking.Web folder and run using the command line:
    • cordova platform add android - this adds all the relevant plugins and platform needed in order to create the apk file. You'll need to run this only once at the beginning or if you update/add a plugin.
    • npm build -- -c android - this will create the client code needed for cordova to use - run this every time you change the typescript/html/(s)css code
    • npm build-apk - this creates the unsigned apk file
    • Using powershell you can use the following command line to sign the app: Invoke-Expression "& ""$env:ANDROID_HOME\build-tools\28.0.2\apksigner.bat"" sign --ks .\IHM.jks --ks-key-alias ihmkey --ks-pass pass:<key-store-password> --key-pass pass:<key-password> --out signed.apk .\platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk"
    • If you installed cordova globally you can also run cordova run android and it will create a debug apk and install it either on a simulator or on your device - if your device is plugged in and developer tools are allowed.

iOS

  • Install Virtual box
  • Using the manual here to configure it to run
  • Update the OS to latest version
  • Download and install xCode 9.2 (which supports this version) from here
  • double click the xip file, it will extract the xCode app
  • drag it to applications
  • Go to IsraelHiking.Web folder and run using the command line:
    • sudo npm install -g cordova
    • sudo npm install -g ios-sim
    • sudo npm install -g ios-deploy --unsafe-perm=true
    • cordova platform add ios
    • cordova build ios --release --no-telemetry

Additional info here