Warning Older Docs! - You are viewing documentation for a previous released version of RhoMobile Suite.

Build time configuration

Build time settings are dictated by a file in your app directory called build.yml. By default, this file has the most commonly used settings and some defaults that will work fine for most platforms. However, you may need to modify it at certain points. For example, if you need to build for an iOS device, you’ll need to change the iphone: sdk: section to use an iphoneos SDK instead of an iphonesimulator SDK. This doc will provide guidelines and examples of how to modify this file without jeopardizing your app.

Default build.yml Settings

When you create your app, a default version of the build.yml file will be generated and it will look like this:

#sdk: "/path/to/rhodes_gem"
sdkversion: 5.0.0
name: My RhoMobile App
version: 1.0
vendor: rhomobile
build: debug
applog: rholog.txt
iphone:
  configuration: Release
  sdk: iphonesimulator7.0
  provisionprofile:
  codesignidentity: iPhone Developer
  entitlements: ""
  BundleIdentifier: com.rhoappbuildersinc.myrhodesapp
  BundleURLScheme: buildymltest
wp8:
  productid: '4ff21ee0-8ef1-0132-ec69-7831c1c374dc'
android:
  manifest_template: 'AndroidManifest.erb'
  version: 2.3.3

wm:
  #sdk: "MC3000c50b (ARMV4I)"
  #sdk: "Windows Mobile 6.5.3 Professional DTK (ARMV4I)"

extensions: ["rhoconnect-client"]

Settings Details

Group\\Setting Description Possible Values Example
sdk Path to your rhodes gem. This is commented out by default to let rhodes determine the latest gem and use that. If you have multiple rhodes gems and you wish to use one that is not the latest one, specify that here. String "/path/to/rhodes_gem"
sdkversion The version of your Rhodes gem. Rhodes Version 5.0.25
name The name of your app. String My RhoMobile App
version The version of your app. App Version 1.0.5
vendor The name that will be set as the vendor of your app. Usually this will be your Company's name. String RhoApp Builders, Inc.
build Build configuration of this version of your app. Debug
development
release
development
applog Name of app log file on the device. Log file name /path/to/log_file.txt
iphone\\configuration Build configuration to pass to XCode. Debug
Distribution
Release
Distribution
iphone\\sdk The version of the sdk used to build. Typically, iphonesimulatorX.X or iphoneosX.X. iPhone SDK Version iphoneos8.0
iphone\\provisionprofile The UUID of your provisioning profile to use when signing. UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
iphone\\codesignidentity The name of the code signing identity to use when signing for device. Code Sign Identity, String rhoAppDevIdentity
iphone\\entitlements Property list file for entitlements for your build. Typically, Entitlements.plist. .plist file myAppEntitlements.plist
iphone\\BundleIdentifier Bundle identifier – used in provisioning profile. String com.rhoappbuildersinc.myrhodesapp
iphone\\BundleURLScheme Bundle URL scheme of your app (used for opening your application from another application by using custom URL scheme). String My Rhodes App
wp8\\productid A productid GUID to application build.yml. GUID '17d460b0-701f-0131-ea62-482a14303cd5'
android\\Manifest Template It is possible to specify manifest erb template file at build.yml. Manifest Template File manifest_template: 'AndroidManifest.erb
android\\version The version of Android for which you will be building. Android version 2.3.3
extensions Comma-separated list of extensions your app will be using. Comma-separated list ["rhoconnect-client"]

Other Build-time Settings

The following are some non-default settings that you may add to the build.yml in certain circumstances.

Group\\Setting Description Possible Values Example
App Type If you are building an app for Windows Mobile or Windows CE you must specify the app_type as "rhoelements" in your build.yml file. By default, this value does not exist in the build.yml and is only necessary to specify a RhoElements licensed app. "rhoelements" app_type: "rhoelements"
Android Title If you want your app to hide the default android title bar, you need to set android_title to '0' in your build.yml file. 0 - Hidden1 - Visible android_title: 0
JS API Bridge This option is typically only used for debugging purposes. If your AJAX-based app is not working properly, you can set this to true. If your application code resides on a remote server (as opposed to running locally), the Rhomobile Javascript APIs will not be available when this settings = true. true - Enabledfalse - Disabled ajax_api_bridge: true
JavaScript and CSS Obfuscation To enable JavaScript and/or CSS code obfuscation of the files in the public folder of your app, just add the following lines to the build.yml:
obfuscate:
  js: yes
  css: yes
  exclude_dirs: ["jqmobile", "jqtouch", "jquery"]
The jqmobile, jqtouch, and jquery folders must be excluded when obfuscation is enabled, because the obfuscated versions of these libraries are there already.
If JavaScript or CSS code obfuscation is not required, then just omit js or css line accordingly. obfuscate:
  js: yes
  css: yes
JavaScript and CSS Minification To enable JavaScript and/or CSS code minification of the files in the public folder of your app, just add the following lines to the build.yml:
minify:
  js: true
  css: true
  exclude_dirs: ["jqmobile", "jqtouch", "jquery"]
The jqmobile, jqtouch, and jquery folders must be excluded when minification is enabled.
If JavaScript or CSS code minification is not wanted, then just omit js or css line accordingly. minify:
  js: false
  css: false
  exclude_dirs: ["jqmobile", "jqtouch", "jquery"]
Building for Intel-Based Processors on Android By default, the build process will build only for ARM-based processors but, Rhodes can be configured to build for Intel-based processors instead. To build for such a device, you must set a flag in your build.yml file. You can also elect to build for both arm AND Intel-based processor by specifying abis: [arm, x86]. x86 - Build for Intel Processors
arm - Build for arm-based processors
android:
  abis: [x86]
Production iOS To build iOS for production, there are a few settings that need to be added to your build.yml file in order to allow Rhodes correctly configure the build. You'll need to add the mobileprovision file, the certificate_file, and the certificate_password in a production sub-heading in the iphone section of the build.yml as shown below.
iphone:
...
  production:
    mobileprovision_file: "./production/PROVISION.mobileprovision"
    certificate_file: "./production/CERTS.p12"
    certificate_password: "PASSWORD"
you'll need to add your custom information into the appropriate fields here. mobileprovision_file: "./production/PROVISION.mobileprovision"
certificate_file: "./production/CERTS.p12"
certificate_password: "PASSWORD"

Capabilities

There are two ways of modifying your app’s capabilities:

  • Direct Edit - Just open the file and edit it.
  • RhoStudio Modification - The RhoStudio IDE provides a GUI for modifying the capabilities using check-boxes.

Direct edit

You can easily change specific settings in your build.yml file by simply opening it in you favorite text editor and modifying the text.

To enable specific device capabilities, edit your application’s build.yml as follows:

capabilities:
  - camera
  - gps
android:
  capabilities:
    - network_state

Rhodes support common plus platform-specific capabilities. They are merged into a single list at build time.

Note: Right now only Android recognizes these platform specific configuration options. However, we are planning to enable these options across all platforms.

List of supported capabilities:

  • audio: allow using of audio hardware (record audio, modify audio settings)
  • camera: allow use of hardware camera
  • gps: allow use of geo location service
  • network_state: allow read device network state (connected/disconnected)
  • phone: allow make calls/read phone state
  • pim: allow read/modify personal information and contacts
  • push: allow to use PUSH on device
  • record_audio: allow recording audio (‘audio’ implies it)
  • vibrate: allow to use hardware vibration mechanism
  • bluetooth: allow to use bluetooth hardware
  • calendar: allow access to default device calendar
  • sdcard: allow writing to SD card on Android devices

Windows Mobile / Windows CE Specific Settings

You can specify where the config.xml file will reside on your device using the config: option.

wm:
  rhoelements:
    config: "/Config/Config.xml"
  • config : path to the custom Config.xml file to use. This path is relative to the RhoMobile Project.

Android Specific Settings

The capabilities listed above are directly related to the Android device capabilities that your app will require and that the user will be asked to give permission to when installing the app. You can add capabilities to your Android app by adding a capabilities section to your build.yml in the android heading as such:

android:
    capabilities:
      - hardware_acceleration
    mapping: yes
    extensions:
      - gmaps
  • hardware_acceleration: enables the hardware_acceleration capability for Android applications
  • mapping: enables the use of mapping apps.
  • gmaps extension: enables the use of Google maps for mapping. In RhoStudio, you can double-click on your application’s build.yml and edit from the text editor; otherwise, you can edit build.yml directly.

Note: Some versions of Android require hardware acceleration to play embedded video.

RhoStudio Modification

You can also edit the capabilities that your app will have access to through RhoStudio. To do this, double click your build.yml in your app’s project in the project explorer pane in RhoStudio.

img

Once you have done this, you should see the following screen wherein you can modify your build.yml settings, mainly, the capabilities.

img

Click the add button next to the capabilities field to bring up this window and add capabilities by clicking the corresponding check-box.

imgimg

You’ll notice that as you add capabilities to your app, the build.yml text file will change to reflect these added capabilities.

img

RhoGallery Security Token

To restrict access to the application you may have it built with a security token. Specify the security token in the build.yml and build the app. Apps built with a security token can be started in normal mode only if you provide this token as a parameter. If you do not specify the correct security token in the start params, the app will close on start by default. If you want do something instead of exit (for example show special message or run application in limited mode etc.) you can define another start_path for your application in “rhoconfig.txt”:

invalid_security_token_start_path = '/app/InvalidSecurityTokenStartPage'

Specify security token in build.yml:

security_token: 123

Run application with special parameter:

System::run_app( 'app_name', "security_token=123" )

Rhobuild.yml Configuration

After installing the RhoMobile Suite, you must tell the software where you have certain files on your machine. To do this, we generate a bunch of default setting in a file called rhobuild.yml. Below is the default appearance of that file:

env:
  paths:
    java: "C:/Program Files/Java/jdk1.6.0_11/bin"
    android: "C:/Android/sdk"
    android-ndk: "C:/Android/ndk"
    cabwiz: "C:/Program Files (x86)/Windows Mobile 6 SDK/Tools/CabWiz"
    msbuild: "C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe"
    vcbuild: "C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/vcpackages/vcbuild.exe"
build:
  wmpath: "platform/wm"
  wp8path: "platform/wp8"
  androidpath: "platform/android"
  iphonepath: "platform/iphone"
android:
excludedirs:
  all:
# Google API key obtained from http://code.google.com/intl/en/android/add-ons/google-apis/mapkey.html
#apikey: "GOOGLE-API-KEY-FOR-ANDROID"
# This is version of Android platform used to run emulator. If not specified, latest available will be used.
#version: 1.6
# This enable/disable native geo mapping for Android. Disabled by default
#mapping: yes
# Here data for production certificate located. If file pointed by certificate: does not exist, it will be auto-generated
#production:
#  certificate: /path/to/developer/certificate
#  password: "password-for-certificate"
#  alias: "certificate-alias"
  - "**/.*.swo"
  - "**/.*.swn"
  - "**/.DS_Store"

Rhobuild.yml Properties

  • env - Environment settings.
    • paths - Paths to necessary build tools.
      • java - The path to your Java’s binary folder.
      • android - The path to your Android SDK.
      • android-ndk - The path to your Android NDK.
      • cabwiz - The path to your Windows Mobile 6 cabwiz file.
      • msbuild - The path to MSBuild.exe.
      • vcbuild - The path to vcbuild.exe.
    • build - This is where the binaries will be stored once they are built for each specified platform.
      • wmpath - Windows Mobile .cab file path.
      • wp8path - Windows Phone 8 executable file path.
      • androidpath - Android .apk file path.
      • iphonepath - iOS .ipa file path.
    • android - Settings specific to Android builds.
    • excludedirs - Directories to exclude from the build.
    • apikey - Google API key.
    • version - The version of the Android platform to run in the emulator. If not specified, latest will be used.
    • mapping - This enable/disable native geo mapping for Android. Disabled by default.
    • production - Settings used in production builds.
      • certificates - The path to your developer certificate.
      • password* - Your developer certificate password.
      • alias - Your certificate alias.

Modifying rhobuild.yml settings

To modify these settings, there are two methods:

  1. Modify these settings in the properties of RhoStudio.
  2. Modify the rhobuild.yml file directly.
    • On mac, the file resides in the rhodes- directory.
    • on Windows, the file resides in the RhoMobileSuite directory
Back to Top