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.
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"]
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"] |
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:
|
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:
|
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.
|
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" |
There are two ways of modifying your app’s capabilities:
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:
You can specify where the config.xml
file will reside on your device using the config:
option.
wm: rhoelements: config: "/Config/Config.xml"
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
Note: Some versions of Android require hardware acceleration to play embedded video.
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.
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" )
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"
To modify these settings, there are two methods: