Build Titanium mobile in Sublime Text 2

I don’t think I’ve ever heard someone who like Titanium Studio, and I don’t either. Titanium comes with a CLI as well and Sublime Text 2 can have custom builds.

So, lets make them work together!

First of all, you need to download and install Titanium and Sublime Text 2. After you’ve installed everything, start a new mobile project in Titanium Studio and make the dir ~/Development/YourApp (you will use this dir later).

It’s time to make a custom build in ST2. Click Tools->Build System->New Build System. Custom build in Sublime Text 2.

This gives you a new file in which you enter this (this launches iPhone 5 retina in iOS simulator):

{
    //Adjust the --sdk to your version.
    "cmd": "/usr/local/bin/titanium build --platform iphone --sdk 3.1.0.GA --log-level trace --target simulator --ios-version 6.1 --device-family iphone --sim-version 6.1 --tall --retina --skip-js-minify --no-colors --no-prompt",
    //We need to tell which path to use
    "path": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
    "shell": true,
    //Enter the working dir for you app
    "working_dir": "~/Development/YourApp/"
}

cmd+s to save, choose your build in Tools->Build System and then cmd+b to build and launch your Titanium Mobile app in iOS Simulator.

Titanium Mobile App