Published on

Building Titanium SDK on Fedora

Authors

These direct steps (using the openjdk, not the Sun one) are confirmed to work...

Below, the following are our (typical) values :

MY_ANDROID_SDK : /path-to-android-sdk-installation-root/android-sdk-linux_86
MY_TITANIUM_DEVELOPER_DIR : /path-to-titanium-developer-installation-root/Titanium Developer-1.2.1
MY_TITANIUM_FILES_DIR : /path-to-my-home-directory/.titanium
MY_TITANIUM_SDK : /any-suitable-directory/

Note that MY_TITANIUM_FILES_DIR is the default created/used by the Titanium Developer program, which one runs from MY_TITANIUM_DEVELOPER_DIR using ./Titanium Developer

Check that the build tools are installed

On Fedora (and this assumes that the openjdk is being used, rather than the Sun JDK) :

yum -y install scons java-1.6.0-openjdk-devel
alternatives --config javac  # Check that this is set to the openjdk path : /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/javac

Ensure correct android modules loaded

Since we're coding for Android 1.6, we need the 'level 4' APIs. Go into the 'Android SDK and AVD Manager' which is located in MY_ANDROID_SDK/tools/ as an executable called android.

There, chose, and install at least the following :

Android SDK Tools, revision 6
SDK Platform Android 1.6, API 4, revision 2
Google APIs by Google Inc., Android API 4, revision 2

where higher revision numbers would most likely work too. Importantly, though, the API numbers should match.

Download and build the latest Titanium API code

cd ${MY_TITANIUM_SDK}
git clone git://github.com/appcelerator/titanium_mobile.git

Now go into the code base and build everything (using the paths as above) :

cd titanium_mobile/
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk.x86_64/ ANDROID_SDK=${MY_ANDROID_SDK} scons

This will create a zip file of the newly built Titanium SDK modules in : ${MY_TITANIUM_SDK}/titanium_mobile/dist. Have a look :

ls -l dist/

Hopefully, there will be a new zip file called something like : mobilesdk-1.3.1-linux.zip

Unzip the new SDK so that Titanium Developer can find it

Go to the 'working directory' of Titanium Developer (not the application directory), and unzip the zip file built in the previous step :

cd ${MY_TITANIUM_FILES_DIR}
unzip ${MY_TITANIUM_SDK}/titanium_mobile/dist/mobilesdk-1.3.1-linux.zip

Fire up Titanium Developer, and change the project

cd ${MY_TITANIUM_DEVELOPER_DIR}
./Titanium\ Developer

Chose the project that you're working on, and change the SDK version it depends on via the drop-down on the Project's Edit tab (listed as 'Titanium SDK') : There should be a new '1.3.1' SDK listed.