Continuous Integration and Deployment (CI/CD) for mobile apps (Appcelerator)


The purpose of this document is to give a step by step approach for installing a continuous integration and continuous build server. This document will cover end to end instructions in getting code from a developer’s environment to the application delivery server for testers to download and test against. This will also include testing the code using the Jasmine test suite and building each platforms ( ipa, .apk) files.
What this is not

  • Instructions on how to build a test suite with Jasmine
  • Recommendation on the type of server configuration such as hardware/VM requirements (RAM, HD).
  • Covering unsupported versions, future or past, of the Axway Appcelerator SDK.
  • Will only cover a basic setup of Jenkins and not a detailed approach to every aspect of the software.
  • Details on publishing applications to Apple’s App Store or Google Play Store.
  • Details on how to use Github tokens or webhooks


Required Accounts and Prerequisites

You will need a valid Apple ID and developer license to install XCode and manage your provisioning files. You also need a valid Axway Appcelerator account to download and install the SDK.
You will need OS 10.10.X or above running on

  • Macintosh hardware
  • Or VM of the Mac OS.


The following software will be needed on the build server. It is however important that you install them in order. Not installing them in the order specified in this document may cause some issues with user permissions. All versions of the software should be the latest versions available unless specified.

  • Java 6, 8
  • Jenkins
  • Node.js
  • xCode


It is important that these steps are done in order. This will avoid any issues with user permissions regarding Jenkins.


Make sure you have these versions of Java installed
Java 6
Java 8 se dev

Jenkins setup and user promotion

Download and install, follow set up instructions
In a command prompt do the following in order to get the initial password
$ sudo su - Jenkins
$ cat /Users/Shared/Jenkins/Home/secrets/initialAdminPassword
Setting up the Jenkins user and promote it to an admin.
Make the Jenkins user automatically login when the computer is restarted:

  1. Go to System Preferences\Users & Groups.
  2. Unlock the settings by clicking the lock in the bottom left corner of the page and entering the login password for the current user.
  3. Select the Jenkins user from the list of users. Note: On our install, the Jenkins user shows up as empty in the list of available users. To fix this, right-click the empty user and select Advanced Options… which will show you details on the user. Set the Full Name to Jenkins and press OK.

Give it a full name.

  1. Click Reset Password. Create a new password for the Jenkins user, and make sure to take note of it somewhere secure. This is just like any other Mac user login that has admin access, and should be treated as such.
  2. Select Login Options underneath the list of users.
  3. Select Automatic login and choose Jenkins.
  4. Enter the password you just created for the new Jenkins user.
  5. Restart your computer. Once finished, you should be automatically logged in as the OSX Jenkins user.


Allow Jenkins to Run GUI Applications

By default, Jenkins is unable to run GUI applications because it runs as a Daemon. A daemon runs in the background as part of the overall system, and isn’t tied to a specific user. This would be like having a butler that couldn’t interact with anyone. Sure it could clean up after us, but what about answering the door or fetching my martini!
A big part of CI is running simulators and other GUI applications, so we’ll need another option. To fix this, you can change Jenkins to run as a Launch Agent. A launch agent runs in the background on behalf of a user.
To change how the Jenkins process is launched, you’ll need to edit the settings file and change its location so it will automatically start on reboots.
Enter the following command to unload Jenkins as a Daemon: $ sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
Next, move the. plist file, which defines how Jenkins will run, to the LaunchAgents folder: $ sudo mv /Library/LaunchDaemons/org.jenkins-ci.plist /Library/LaunchAgents/
The default .plist file that Jenkins creates adds a key-value pair called SessionCreate. This creates issues when running certain applications, such as iOS simulators. The reason for this? Honestly, I’m not sure. In the past, a fix to many Jenkins CI issues in the iOS world was to add this key manually. It seems that with Xcode 6 things have reversed and it’s now required that you remove the key which solves the issue. Open the file with the editor of your choosing, and remove them.
$ sudo vim /Library/LaunchAgents/org.jenkins-ci.plist

/* Remove the following lines */
<true />
/* Save the file */

Lastly, reload the Launch Agent to restart Jenkins.
$ sudo launchctl load /Library/LaunchAgents/org.jenkins-ci.plist
Keep Those Fingers Crossed

Now, restart your computer and make sure that Jenkins successfully starts on its own after the reboot. If working correctly, your Mac should automatically login to the Jenkins user.

Login as Jenkins user

Install xCode from App Store (* Run once after install to finalize install)

Install Node.js

Install Appcelerator cli

$ sudo npm install appcelerator -g
– Update Appc to install latest version
$ appc init

Install Titanium

$ npm install titanium -g
$ appc ti sdk install

Install Android

Download android tools
Download platform tools
Download NDK
Create directory and unzip the tools into the android-sdk-macosx folder
$ mkdir /Users/Shared/Jenkins/Library/android-sdk-macosx
$ cd /Users/Shared/Jenkins/Library/android-sdk-macosx
To install the latest Android SDK
$ titanium setup android
Use Paths when asked
/Users/Shared/Jenkins/Library/android-sdk-macosx/[NDK FOLDER NAME]
NOTE: When you do your first build, and hyperloop error, fix it by creating a new project on the build server with hyperloop to install modules then just delete it. $ appc new
If you get the error file already exists symlink, delete the build folder
Install android SDK build tools (use latest)
(example: $ ./sdkmanager "build-tools;26.0.1”)
Install platform 23 (optional but may be needed)
$ ./sdkmanager "platforms;android-23"

Jenkins Setup

Login with your credentials

  • Under Manage Jenkins set up SCM (e.x. github) hooks
  • Generate a new job (see Jenkins doc for details)
  • Point to your build script
source /Users/Shared/Jenkins/Documents/

Add build script and set permissions $ chmod +x /Users/Shared/Jenkins/Documents/

Example script

echo "pulling latest"
git -C /Users/Shared/Jenkins/Documents/AutomatedBuildTest pull
export PATH="/usr/local/bin:${PATH}"
jasmine-node /Users/Shared/Jenkins/Documents/AutomatedBuildTest/spec/jasmine_examples/PlayerSpec.js

# appc run -p android -T dist-playstore [-K <KEYSTORE_FILE> -P <KEYSTORE_PASSWORD> -L <KEYSTORE_ALIAS> -O <OUTPUT_DIRECTORY>]
appc run -d /Users/Shared/Jenkins/Documents/AutomatedBuildTest -p android -T dist-playstore -K ~/.android/android.keystore -P ****** -O ~/Desktop -b --app-preview --release-notes='Automated Build Android' --notify='Devs,QA'

# NOTE RUN $ appc info to get the ids for provision file, and cert
appc run -d /Users/Shared/Jenkins/Documents/AutomatedBuildTest -p ios -T dist-adhoc -R ‘Axway Software’ -P ‘c11b6587-ddc1-421d-a209-4f1893110054’ -O ~/Desktop -b --app-preview --release-notes='Automated Build iOS' --notify='Devs,QA’


  • Generate personal access token and set up webhooks url
  • Clone project to shared location $ cd /Users/Shared/Jenkins/Documents/
  • Clone project $ git clone [YOUR PROJECT URL]
    (example $ git clone

Jenkins Freestyle Project Setup

Create a New Item in Jenkins
Select Freestyle project
Point to your project

Add your repository link

Set up your hooks



Install Jasmin and Jasmin-node globally
$ npm install -g jasmine
$ npm install -g jasmine-node

Android adhoc setup

Create key store for Android
$ mkdir ~/.android
$ keytool -genkeypair -v -keystore path/file_name -alias alias_name -keyalg RSA -sigalg SHA1withRSA -validity 10000
(example: $ keytool -genkeypair -v -keystore ~/.android/android.keystore -alias testingKey -keyalg RSA -sigalg SHA1withRSA -validity 10000)
check key
$ keytool -list -v -keystore path/file_name
(example: $ keytool -list -v -keystore ~/.android/android.keystore )
Build packages
$ touch ~/.android/repositories.cfg
$ cd ~/Library/android-sdk-macosx/tools/bin
$ ./sdkmanager "system-images;android-23;google_apis;x86"
Build Android APK file (should be in script)
$ cd /Users/Shared/Jenkins/Documents/[YOUR PROJECT]
(example: $ cd /Users/Shared/Jenkins/Documents/AutomatedBuildTest)

$ appc run -p android -T dist-playstore [-K <KEYSTORE_FILE> -P <KEYSTORE_PASSWORD> -L <KEYSTORE_ALIAS> -O


( example : $ appc run -p android -T dist-playstore -K ~/.android/android.keystore -P ******* -O ~/Desktop)


Create a Distribution certificate for your build machine.
Create a CSR file.
In the Applications folder on your Mac, open the Utilities folder and launch Keychain Access.
Within the Keychain Access drop down menu, select Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority.

  • In the Certificate Information window, enter the following information:
  • In the User Email Address field, enter your email address.
  • In the Common Name field, create a name for your private key (e.g., John Doe Dev Key).
  • The CA Email Address field should be left empty.
  • In the “Request is” group, select the “Saved to disk” option.
  • Click Continue within Keychain Access to complete the CSR generating process.

Create a new iOS Certificate for the build machine using your newly created

Download and add to your keychain login

Create a new App Id (if you haven’t already)

Create a new adHoc Provisioning Profile (if you haven’t already)


xCode (in order to grab all your provision files)

  • Log into Xcode and download provision file.
  • To check that they are installed run $ appc info

First Build

Before your first build log into appc with command line $ appc login follow instructions

App Preview

The first time you run the build you might need to manually set up users to notify on subsequent builds.

Helpful Links

Command line help for adhoc builds!/guide/Appcelerator_CLI_Tasks-section-src-43306725_AppceleratorCLITasks-iOSAdHocDistribution
App Preview location and documentation – !/guide/App_Preview
CLI Command Tasks Documentation – !/guide/Appcelerator_CLI_Tasks – !/guide/Appcelerator_Command-Line_Interface_Reference – !/guide/Titanium_Command-Line_Interface_Reference
Distributing iOS and Android – !/guide/Distributing_iOS_apps – !/guide/Distributing_Android_apps
Example Project

Loading Facebook Comments ...