Configuration for the tools

Configuration settings concerning things like developer certificates shouldn't be shared across a whole team. This configuration is stored in a file called local_config.json, and can be updated through the "Tools Config" tab in the Trigger Toolkit.

The file must be located along side the src/ directory, for example:

my-app/
    development/
    src/
    local_config.json

If you're using the command-line, all local config can be overridden with command-line switches too.

Modifying the configuration for the tools

You can edit your local configuration through the Toolkit UI by clicking the Tools config link in the sidebar:

Toolkit Local Config

Alternatively, edit the file directly using your preferred text editor.

Format of local_config.json

local_config.json is a JSON file which specifies various runtime parameters of the forge commands.

There is a general section, for parameters which are not linked to any particular target, and then per-target sections: ios, android and so on:

{

  "general": {

    "reload": {
      "external": true

    }

  },

  "ios": { 
    "device": "simulator", 
    "profiles": { 
      "DEFAULT": { 
        "provisioning_profile": "/home/trigger/development.mobileprovision" 
      }, 
      "release": {
        "provisioning_profile": "/home/trigger/release.mobileprovision",
        "developer_certificate": "iPhone Distribution",
        "developer_certificate\_path": "C:\developer.pfx",
        "developer_certificate_password": "myp4ssw0rd"
      }
    }
  },

  "android": { 
    "sdk": "/opt/local/android-sdk", 
    "profiles": { 
      "DEFAULT": { 
        "keystore": "/home/trigger/development.keystore",
        "keyalias": "trigger" 
      },
      "release": { 
        "keystore": "/home/trigger/release.keystore",
        "keyalias": "trigger" 
      } 
    } 
  }
}

A note on file paths

You can specify files using a path relative to the current directory, or you can use an absolute path.

On Windows, you will need to escape the backslashes in paths for your configuration file, e.g.:

{
  "andoid": {
    "sdk": "C:\\Users\\Tim Monks\\android-sdk-windows"
  },
  "profiles": {
    "DEFAULT": {
      "keystore": "..\\default.keystore"
    }
  }
}

Profiles

In the target-specific sections (e.g. ios, android), you can use profiles.

Profiles allow for quick switching between configuration settings at different phases of your development.

For example, you need to use different credentials to sign iOS apps when creating builds for testing and builds for deployment to the App Store.

By creating a different profile in this section, you can quickly change between collections of configuration settings by changing the "Profile" setting in the Tools config, or by naming a profile with the --profile command-line argument.

If no --profile argument is given, Forge attempts to use a profile called DEFAULT - it's case sensitive, so you can create and use a profile called default if you wish, for example.

Important: When supplying command-line overrides to profile settings, they take a form like --ios.profile.name value, where name is the setting name to be overridden, and value is the setting value.

Available Forge Parameters

general

General parameters are configuration settings not related to any particular target.

There is currently only one possible setting in this section to enable Reloads from external CDNs:

"reload": {
  "external": true
}

ios

This section contains settings pertaining to building and running Forge apps for iOS.

The device to use when running iOS apps is not profile-specific:

Config Option Command-line Option Meaning
device --ios.device Either simulator, device or a specific device ID
simulatorfamily --ios.simulatorfamily Deprecated. Use devicetypeid instead.
simulatorsdk --ios.simulatorsdk Deprecated. Use devicesdk instead.
devicetypeid n/a Specify the iOS simulator ID for the device you want to run
devicesdk n/a Specify the iOS SDK to use for the simulator e.g. iOS 9.0

You can obtain a list of the available devicetypeid's by running the following command on the OSX command line:

xcrun simctl list devicetypes

You can obtain a list of the available devicesdk's by running the following command on the OSX command line:

xcrun simctl list runtimes

All other settings should be placed inside a profile: available settings are shown below:

Profile Config Option Command-line Option Meaning
provisioning_profile --ios.profile.provisioning_profile Provisioning Profile to embed into your iOS app
developer_certificate --ios.profile.developer_certificate Name of certificate to sign iOS app with (OS X only)
developer_certificate_path --ios.profile.developer_certificate_path Path to developer certificate (Windows only)
developer_certificate_password --ios.profile.developer_certificate_password Password for given developer certificate (Windows only)

For more information about creating provisioning profiles, see Creating provisioning profiles.

Note: For more information about building iOS apps on Windows, see Developing iOS apps on Windows

android

Use this section for settings relating to building and running Forge apps for Android.

The location of the Android SDK is not profile-specific:

Config Option Command-line Option Meaning
sdk --android.sdk Path to the Android SDK on your machine.
device --android.device Device identifier to run your app on, e.g. 323406C1AD9090EC
purge --android.purge Completely reset all state of the app before running.

The other settings should be in a profile:

Profile Config Option Command-line Option Meaning
keystore --android.profile.keystore Path to your keystore
keyalias --android.profile.keyalias Alias given to your key in the keystore
storepass --android.profile.storepass Password for your keystore
keypass --android.profile.keypass Password for your key

See Creating a keystore for more details on what you need to do to use these settings.

We recommend using the command-line switches for storepass and keypass, rather than placing them in a configuration file, for security reasons.