In order to work around shortcomings of the Titanium Mobile SDK, or to add custom features to the API, it's necessary to modify the SDK iPhone and Android source code. This can either be done in the pre-built SDK, or the already-built SDK.
Building from Source
The Titanium Mobile SDK is open source under an Apache version 2 license, and is available on Github https://github.com/appcelerator/titanium_mobile. Compiling the SDK from Github source requires Python (w/JSON) and the cross-platform scons build tool: http://www.scons.org/.
- Checkout the source (requires git)
$ git clone git://github.com/appcelerator/titanium_mobile.git
$ cd titanium_mobile
- Edit the SDK source
- Build the SDK
$ scons
- Unpack newly-generated SDK zip from titanium_mobile/dist/mobilesdk-x.x.x-os.zip to your Titanium Mobile SDK directory (on Mac OS, /Library/Application Support/Titanium/mobilesdk/osx/)
- The new SDK should be available to select from within Titanium Studio to build your project.
Modifying an Already-Built SDK
This is only possible with the iPhone SDK, since the Android SDK is compiled into jars.
In order to make modifications to the iOS or Android code in an existing Titanium SDK, follow these steps:
- Navigate to the SDK directory
- Edit code of files to modify and save
- Delete the relevant build folder in your project directory (<project root>/build/iphone)
- Build your project in Titanium Studio.
The changes to the SDK should be reflected in your app.