Troubleshooting Appcelerator Titanium and iPhone iOS 5.1

Posted by on Mar 23, 2012

Update: Appcelerator’s official recommendation dated March 16th is to either downgrade to Xcode v.4.2.1 or living on the edge with Xcode 4.3 (via Mitch Amihod)

Tried to deploy a default Titanium app targeting the iPhone iOS 4.2 onto a physical device with iOS 5.1 installed. As you could probably guess, the app installed on the device as expected but when launched, it would crash after the splash screen.

The trouble is that I had the iOS 4.2 SDK installed. I tried to install the IOS 5.1 SDK, but unfortunately Titanium Studio would only recognize the iOS 3.0, 4.0, 4.1 and 4.2 SDKs. I tried to re-target Titanium Studio to recognize the iOS 5.1 SDK, but to no avail – iOS 5.1 would not show up as an option no matter what. After doing some digging around, I found a file called builder.py in the Titanium Studio application path that had a command called -showsdks (at line 50) which provides the Titanium Studio IDE with the list of targetable platforms. For example:

xcodebuild -showsdks

I typed in the command in Terminal and got the following result:

Mac OS X SDKs:
Mac OS X 10.5                 -sdk macosx10.5
Mac OS X 10.6                 -sdk macosx10.6

iOS SDKs:
iOS 4.2                       -sdk iphoneos4.2

iOS Simulator SDKs
Simulator - iOS 3.2           -sdk iphonesimulator3.2
Simulator - iOS 4.0           -sdk iphonesimulator4.0
Simulator - iOS 4.1           -sdk iphonesimulator4.1
Simulator - iOS 4.2           -sdk iphonesimulator4.2

After a few hours of troubleshooting, I discovered the trick was to pretty much uninstall all previous versions of Xcode. The command to do this is:

sudo /Developer/Library/uninstall-devtools -mode=all

Then when you open Titanium Studio, the following message appears:

I decided to install the following components:

To test out the new install (and crossing my fingers), I created a new blank Titanium mobile project targeting the Appcelerator 1.7.6 SDK. When deploying the app to my iPhone, I selected the iOS 5 SDK as a compile target. The app deployed to my phone, and lo and behold, it worked! Hope the instructions are helpful for you too.

If you want clarity on what Xcode version contains what iOS SDK version (which can get quite convoluted when you try to explain it out loud), here is a Wikipedia entry to hopefully help clear things up: http://en.wikipedia.org/wiki/IOS_SDK

No Comments

Trackbacks/Pingbacks

  1. Setting Up Appcelerator Titanium for iPhone Development in 4 Easy Steps | Make It So! - [...] sure to read part 2 of this blog post “Troubleshooting Appcelerator Titanium and iPhone iOS 5.1” to learn what …
  2. Setting Up Titanium Studio 1.0.9, Xcode 4.3.2 & iOS 5.1 | Make It So! - [...] latest iOS development environment for Titanium Studio (it’s essentially a quick follow up to my two previous blog [...]