As my journey with Appcelerator continues, I’ve run into another annoyance, and the fix wasn’t immediately obvious. Titanium Studio ships with an Android 2.2 image pre-configured, although I am trying to develop for Ice Cream Sandwich ( Android 4 ). The problem is, every time I launch my application, it would ignore the running emulator ( launched using AVD Manager ) and launch it’s own. This is really irritating, as the Android emulator takes forever to load. ( About a minute for 2.2, and well over 5-10 minutes for ICS, on an i7 machine with 12GB of RAM! ) to say nothing of the fact their emulator image is for a phone, not a tablet.
It seemed no matter what I did, it would still load a new instance of the emulator, regardless to if I had one running already. The answer isn’t as intuitive as you would think. My first thought was it would be under Debug Configurations, which can be accessed by right clicking tiapp.xml in your project, choosing Debug As –> Debug Configurations… which brings up the screen below:
Ah, this looks promising, change Android API level to Android 4.0, click Apply then debug. Still loads the pre-configured 2.2 emulator. Ok, so that wasn’t it.
In the end, it comes down to how you build your project. In Project or Package Explorer, double click tiapp.xml to bring the property editor up. Search for the “Deployment Targets” section, then click the configure link, like this:
In the dialog that pops up, there is a selection for “Default Android SDK:”. This is the value you need to change:
Now I click debug and behold! Ice Cream Sandwich goodness!
Well… that was intuitive. Not really something you can blame Appcelerator for, nor Titanium Studio ( although again Eclipse/Google Android tools make things far too complicated! ) in the end. That said, if I could debug on a physical device, I wouldn’t have to deal with the terrible Android emulator in the first place!
Anyways, finally after a few days of messing about with configuration and install issues, finally, time for some coding!