Building Cordova apps

Setting up a Cordova app on Nevercode

This tutorial guides you through setting up your Cordova app on Nevercode. Nevercode doesn't require any kind of additional software or configuration files from your side. We’ll scan your repository and from what you have there, our builders find everything they need. You’ll just have to confirm what configuration you want to build.

The guide covers how to:

Cordova project structure

To identify an app as Cordova, Nevercode looks for a "signature" comprised of 2 components. The config.xml file will be present by default in any project that began its life as Cordova. However, if you are converting e.g. a Phonegap project to Cordova, please be sure to address all the points below before adding your project to Nevercode.

  • Cordova namespace must be correctly specified in the config.xml file in the root folder of your project. Here's what this looks like:
    <widget id="com.your.project" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

  • There must be no ionic.project or ionic.config.json file in the root folder of you project. This won't be something you'll have to worry about unless you are converting your project from Ionic to Cordova. However, this file is the only distinguishing feature between Ionic and Cordova projects, which is why this is part of the Cordova "signature".

Add a new app

  1. Click Add a new app on Nevercode dashboard.
Nevercode dashboard

Nevercode dashboard

  1. Select the appropriate option for where your app repository is hosted. See Specifying app repository for details. If you choose to add the repository manually, see Defining checkout URL and Authenticating repository access for details.

Define build configuration

After specifying app repository, Nevercode takes a first look at it by listing the branches in this repository. The next step for you is to select the branch you want Nevercode to scan for projects.

  1. Select a branch from the dropdown that Nevercode should scan. Note that you can change the branch later if needed.
  2. Click Scan branch. Nevercode scans the repository from the specified branch. This includes cloning the repository, looking for projects from it and searching for the configurations. All these actions can be monitored real-time from your browser via the live log window.
  3. Once scanning the branch has finished, you need to select a project from the Project dropdown. The Project selection here means a directory in your repository where the Cordova configuration file config.xml is stored.
  4. Select an option in Configuration dropdown, so Nevercode will know whether to build the debug or the release version of your app.
  5. Select the platform for which you'd like to build your app (Android or iOS, or both platforms).
Build configuration

Build configuration

  1. Enable the appropriate build options by checking the corresponding boxes.
  2. Finally, click the Save and start build button. Nevercode will start the very first build of your app and you can monitor the real-time logs right in your browser.

Manage dependencies for Cordova apps

Cordova applications usually depend on additional Node modules. Nevercode installs the dependencies listed in your project's package.json file automatically with npm install right after your repository has been cloned for building.

Sign Cordova apps

The very first version of your app is built without code signing. Navigate to the Code signing section in your app settings to set it up for iOS and Android.

For detailed information on signing Android binaries, see Signing Android binaries in Cordova.
To sign iOS binaries, please follow the corresponding tutorial for iOS apps.

Signing configuration in build configuration file

Please note that for iOS applications Nevercode respects the signing configuration provided in the build.json configuration file as described in Cordova documentation but you'd still have to upload the provisioning profiles and code signing certificates as described in the iOS code signing guide.

Run tests

To enable testing of your Cordova apps, you must set up a custom test step. Please take a look at our in-depth documentation for testing hybrid applications to see how you can set that up.

Set up Git hooks

By setting up Git hooks, you can have Nevercode automatically build your app every time you push changes to the repository. For instructions, please refer to Building automatically (Git hooks).

Publish build artefacts

Nevercode supports publishing your build artefacts to several distribution channels. See our full list of supported distribution options for more information.

Manage build versions

Nevercode exports two environment variables that you can use in your build scripts: NEVERCODE_BUILD and NEVERCODE_BUILD_NUMBER. You can read more about it from Incrementing Cordova app version.

Other configuration

See also how to: