Testing universal app for iPhone

In my recent posts on creating a Universal version of an app that will work on both the iPhone and iPad I neglected to mention one small caveat when it comes to testing the app.

You cannot currently test the iPhone version of a universal app in the iPhone Simulator. You must test it on an actual iPhone or iPod Touch device.

There is no problem to test the iPad version of your app in the simulator but when you want to test the iPhone version of the app you must attach a physical device. You can then build and run on the device and the iPhone version of the app will be executed.

To understand why this limitation exists remember that when you build a universal app you build it with a base SDK of iPhone OS 3.2 but with a target iPhone OS version of 3.1.x or earlier. This means that the only option you have when building is to specify OS 3.2. If you try to build for OS 3.1.3 for example you will get compiler errors and warnings:

warning: implicit declaration of function 'UI_USER_INTERFACE_IDIOM'  error:
'UIUserInterfaceIdiomPad' undeclared (first use in this function)

This should not really be a surprise since symbols such as UI_USER_INTERFACE_IDIOM only exist in the 3.2 release of the SDK.

Never miss a post!

iOS Size Classes Cheat Sheet

Subscribe and get my free iOS Size Classes Cheat Sheet

Success! Now check your email to confirm your subscription and download your free guide to iOS Size Classes.

There was an error submitting your subscription. Please try again.

Unsubscribe at any time.
No time to watch WWDC videos?

Sign up to get my iOS posts direct to your inbox and I will send you a free PDF of my iOS Size Classes Cheat Sheet.

OK! Check your inbox (or spam folder) for an email to confirm your details and download your free guide to iOS Size Classes.

There was an error submitting your subscription. Please try again.

Unsubscribe at any time.
Archives Categories