Mac OS X Target Installation Guide

Currently, the only directly supported additional target platform on Mac OS X systems are iOS and Android. To deploy your applications also for Windows, you either need a Windows PC or a virtual machine running Windows.

Installing the iOS Toolchain

Actually, if you have already set up Xcode as your development environment for Mac OS X, you do not need to perform any additional steps to start developing iOS applications. Simply use Xcode to build the iOS version of your apps; to verify that this works you may open one of the iOS tutorial projects, e.g.

  • ~/MyMurlInstallation/tutorials/chapter01/00_hello_world/project/ios/xcode/hello_world.xcodeproj

and select "Product -> Run" from the menu, just like with the OSX project.

Installing the Android Toolchain

Summary

  • Install the Android Toolchain (Android SDK, Android NDK and Apache Ant)
  • Create/adapt Environment Variables
  • Install desired Android SDK Platforms

Prerequisites

In order to deploy your applications for Android, you need to download the following packages:

When finished create a directory (e.g. ~/Android) and extract all downloaded zip archives into this directory. The folder structure should look like this:

~/Android
ndk
prebuilt
...
sdk
tools
...
ant
bin
...

At the time of writing, the following versions of SDK and NDK were verified to work with the Murl Engine (other versions may work as well):

  • Android SDK Tools: 23.0.5
  • Android SDK Platform-tools: 21
  • Android NDK: r10c
  • Apache Ant: 1.9.1

Environment Variables

When you are done installing the Android toolchain, you need to provide the information about the install path to the Murl Engine.

If you use the Dashboard, it is sufficient to enter the install path information of the SDK, the NDK and Ant in the Dashboard settings dialog. If you want to use the build scripts also from a terminal, you need to provide two environment variables and adapt your PATH variable:

  • MURL_ANDROID_SDK_ROOT
    should point to the location where the SDK is installed, e.g.
    ~/Android/sdk
  • MURL_ANDROID_NDK_ROOT
    should point to the NDK location, e.g.
    ~/Android/ndk

The following directories need to be in your PATH variable:

  • Apache Ant "bin" directory e.g. ~/Android/ant/bin

If you do not want to permanently change your environment variables, you can create a shell script and call it prior to Android related commands. The script (e.g. ~/Android/init.sh) should look like this:

#!/bin/bash
MURL_ANDROID_SDK_ROOT=~/Android/adt/sdk
MURL_ANDROID_NDK_ROOT=~/Android/adt/ndk
export MURL_ANDROID_SDK_ROOT
export MURL_ANDROID_NDK_ROOT
export PATH=$PATH:~/Android/adt/ant/bin
Note
Use the dot space operator (". ") to execute the script in the current shell without forking a sub shell:
". ~/Android/init.sh"

Android SDK Platforms

To build your apps for a specific Android version, you should download and install the respective SDK platform via the Android SDK Manager. Building the Murl tutorials as they are provided requires at least the API level 10 (Android 2.3.3) SDK. However, you may change the desired version by editing the make file (e.g. project/common/gnumake/module_hello_world_v1.mk) and change the values given for MURL_ANDROID_TARGET_API_LEVEL and MURL_ANDROID_MINIMUM_API_LEVEL accordingly.

In addition the following tools packages are needed: Android SDK Tools, Android SDK Platform-tools, Android SDK Build-tools

sdkmanager-mac.png
SDK Manager
  • Run the SDK Manager (by using the Dashboard or by starting "android" from the Android SDK).
  • Select desired packages to install e.g. Android SDK Tools, Android SDK Platform-tools, Android SDK Build-tools, Android 2.3.3 (API 10).
  • Click the install button and wait until all packages have been downloaded and installed.

ADB Connection

This step is only necessary, if you want to install/debug Android apps directly to/on your mobile phone via a USB cable.

In order to connect your mobile phone with the adb (Android Debug Bridge) to your computer you need to enable USB debugging on the phone itself (e.g. Settings -> Developer Options -> USB Debugging or Settings -> Applications -> Development -> USB Debugging). With USB Debugging enabled you can connect the phone and your computer using the USB cable that came with the phone.

If you do not see "Developer Options" menu entry, go into "About device" in "Settings" and tap on the "Build number" entry seven times, which will unlock the "Developer Options" menu entry.

Start the command adb devices on your computer to test the connection and show a list of all connected devices. Your output should look similar to this:

My-Mac:~ zappbrannigan$ adb devices
List of devices attached
0019735134535e device
My-Mac:~ zappbrannigan$

Testing the Android Build

When you are done, you may test the Android build using one of the provided tutorials, e.g. Hello World V1:

  • Open a terminal shell and navigate to the tutorial's Android project folder, e.g.
    ~/MyMurlInstallation/tutorials/chapter01/00_hello_world/project/android/gnumake
  • Start the Android build, e.g. in debug mode by entering
    ./build_debug.sh
  • Deploy the resulting APK on your target device by entering
    ./install_debug.sh

Please note that a device must be connected to your computer for deployment.

Alternatively also the Dashboard offers a convinient way to build and deploy an Android project.


Copyright © 2011-2024 Spraylight GmbH.