in Appcelerator Titanium

How to Switch Between iPhone Standard and Retina Simulators for Appcelerator Titanium

The iPhone Simulator allows you to switch between viewing a standard display, or a larger 'retina' display to see how your app looks in the different sizes.  I think a lot of devs use one or the other just as a matter of preference, but it is also a great idea to test your apps on both to catch any missing or misspelled @2x or standard graphics that otherwise wouldn't show up to you if you just built against one version or the other.

Changing between standard and retina, while easy to do from within the simulator — just go to menu and select Hardware > Device > and select iPhone or iPhone (Retina) — has always required a little more work when developing with Titanium and Titanium Studio.  You would have to open the Simulator manually (I know, sounds weird, but Studio usually takes care of this when running a build), then change the setting, close the Sim, clean your build, run the build, and do it all again if it didn't take.

While this isn't a huge deal, the recent version of Xcode (4.3) has changed stuff around, making it nearly impossible to find and run the Simulator manually.  Actually, not impossible, but it just doesn't show up in Spotlight, I guess because it is bundled along with the Xcode.app file.  

Never fear, it is easy to track it down manually, and once you do, we can set it up so you don't have to search for it again when you want to change to a different display.  These instructions assume you are running Xcode 4.3 or higher (if you aren't, you probably wouldn't be reading this anyway).

Step 1: Locate the Simulator

In Finder, go to Applications, right click on Xcode, and select 'Show Package Contents'.  From there, go to Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications, and there you will see the Simulator.

The complete file path is:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app

Step 2: Make the Change

Once you find the simulator, run it, then go to the menu Hardware > Device and select either iPhone or iPhone (Retina).  Important: Close the Simulator after making the change.  Then, when you run your app again from inside Studio, it will load in the newly selected Simulator size.

Optional: Save the Simulator for future reference

An easy way to keep from having to browse down into the Xcode package contents in order to open the Simulator manually the next time you want to change the display is to simply drag the iPhone Simulator.app file down to your dock to make a shortcut to it.

Notes

One item you may have noticed when going through the Simulator menu is that under Hardware, there is a menu item to change the Simulator OS version.  You can acually manage this through Titanium Studio by going to Project > Run Configurations (or Debug Configurations) then locate Titanium iOS Simulator and select your project's simulator.  On the right side under Platform, you can change the iOS SDK.

More info on finding the simulator in Xcode 4.3 and higher here.