• Introduction
  • Dev Environment Setup
  • Developing Apps
  • Data Handling
  • Device Capabilities
  • Testing & Debugging
  • Extending
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: "/Users/michaeltoews/.rvm/gems/ruby-2.1.0/gems/rhodes-4.1.0"
sdkversion: 4.1.0
name: build_yml_4.2
version: 1.0
vendor: rhomobile
build: debug
applog: rholog.txt
iphone:
    configuration: Release
    sdk: iphonesimulator7.0
    provisionprofile:
    codesignidentity: iPhone Developer
    entitlements: ""
    BundleIdentifier: com.rhomobile.buildyml4.2
    BundleURLScheme: buildyml4.2
wp8:
    productid: '1d03b940-8ef3-0132-ec6b-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
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.

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 Specific Settings

        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.

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.

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

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

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

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" )
Back to Top