iOS Guide

The goal of this documentation is to provide you a guide on how to use Cordova CLI to package iOS Mobile applications.

Prerequisites

A Mac with the following software installed:

  • node.js with Node Package Manager (npm).

  • Homebrew

  • Cordova CLI

  • Xcode with Xcode Command Line Tools

  • iOS Deploy Tools

Developer or Enterprise certificate with provisioning profile from your Apple Developer Account.

Install Node.js & npm

Download Node.js: https://www.npmjs.com/get-npm

mobile client ios guide1

Choose the recommended version.

mobile client ios guide2

mobile client ios guide3

mobile client ios guide4

mobile client ios guide5

Install Cordova

Open terminal and run this command to install Cordova:

sudo npm install -g cordova

mobile client ios guide6

Install Apple .p12 certificate

Download certificate and provisioning profile from your Apple Developer account. See the debugging documentation for guidance in creating provisioning profile and certificate: https://community.neptune-software.com/documentation/debug-ios-mobile-client

Double-click the certificate to install it into the Keychain. Choose Login as keychain location.

mobile client ios guide7

Install Xcode

Download and install Xcode from the Apple App Store. Read this documentation from Cordova:

Install Xcode command line tools

Install the Xcode command line developer tools in a terminal:

xcode-select --install

mobile client ios guide8

mobile client ios guide9

Install Homebrew

Install Homebrew: https://brew.sh/

/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

mobile client ios guide10

Install iOS Deploy Tools

brew install ios-deploy

mobile client ios guide11

Build and download Neptune Mobile Client

Build your mobile client. Choose Build Cordova in the Neptune Cockpit Mobile Client Configuration. When done, download the .zip file.

mobile client ios guide12

Create a dedicated Cordova project folder on your Mac, so that you always have good control of your builds.

Extract the downloaded .zip file into your Cordova project folder.

mobile client ios guide13

In a pure Cordova project you would now need to create the project, but that is already done. All the files needed to build for iOS, are included in the Neptune Mobile Client export.

Build iOS

In the terminal, navigate to the Cordova project folder you’ve just added from the .zip file. Cordova in my case:

cd Cordova/

Add iOS platform support.

cordova platform add ios

All the plugins will be added plus a lot of other stuff.

mobile client ios guide14

Install fs-extra

npm install fs-extra

Download your iOS developer certificate from the Apple Developer website: https://developer.apple.com/account/resources/certificates/list

mobile client ios guide15

mobile client ios guide16

Download your provisioning profile too. You can read about how to create developer certificate and provisioning profile here: https://community.neptune-software.com/documentation/debug-ios-mobile-client

Double-click on your downloaded certificate and install it into the keychain. Choose "Login" as location.

mobile client ios guide17

mobile client ios guide18

Double-click the provisioning profile, it will be added to Xcode.

Locate the Xcode project file and open that in Xcode.

mobile client ios guide19

Choose your app and "Generic iOS Device".

mobile client ios guide20

Sign your project with a "Development Team".

mobile client ios guide21

Build the iOS project

Back in the terminal in the Cordova project, build the project.

cordova build ios --device --[debug|release]

You will need to enter your keychain master password several times, this is NOT the certificate password.

mobile client ios guide22

Now your .ipa file has been created. Distribute that to your channels. A good start is to upload the .ipa file to Neptune Cockpit and make it available in the Neptune Catalog.

mobile client ios guide23

mobile client ios guide24 Choose: Published: Yes

mobile client ios guide25 Choose: Available in Public Neptune Client_: Yes

You can emulate the mobile client directly from the terminal

cordova emulate ios

mobile client ios guide26

Hardware used in this guide

  • Mac mini (2018) ~ 3.6GHz Quad-Core Intel Core i3, 8GB Ram

  • iPhone SE 2. Gen ~ MX9R2QN/A - 64 GB

Software versions used in this guide

  • Neptune DXP - SAP Edition v.6.0.6

  • macOS Catalina v.10.15.6

  • Xcode v.11.6 ~ 11E708

  • iOS v.13.6.1

  • Cordova v.10.0.0 ~ cordova-ios@^6.1.0

  • node.js v.12.18.3

  • npm v.6.14.6

  • Homebrew v.2.4.13

Check and update Cordova version

You should stay up to date the software used, especially Cordova. Check Cordova version with this command

cordova -v

Check which version is available

npm info cordova version

Update Cordova with this command

npm update -g cordova