Testing different screen resolutions in Universal (iPad,iPhone,iPod) app development

ios-simulatorscreen-resolutionscreen-sizeuniversal

I notice when submitting a Universal app to the app store, there are various screen resolutions to support. I think iPhone/iPod: 320×460, 320×480, 640×960 and iPad 768×1024.

When I specify Universal app development in Xcode, the simulator has a resolution of 320×480. To view 768×1024 screen resolution, I can change the target setting to iPad, but how to test 320×460 and 640×960 resolutions?

My default solution is to target iPad, and manually hack my code, e.g.: SCREEN_WIDTH=640, SCREEN_HEIGHT=960; but surely there should be a setting on the simulator for this!?

In a related question, is there any way to get screen captures off the simulator (apart from command-shift-3 and cropping the resulting image)?

Thanks in advance.

Best Answer

640x960 is an iPhone 4. You can simply select "iPhone 4" in the simulator device menu. You'll notice everything is twice as big (unless your computer has a small screen).

The iPhone 4 will still say its screen is 320x480 according to [[UIScreen mainScreen] applicationFrame].size see here for a discussion.

460x320 is the standard iPhone/iPod Touch screen minus the size of the status bar. You don't need to support it separately from 480x320.

Note: The "iPhone 4" option has been renamed "iPhone (Retina)" in recent simulator versions.

I don't think there is a better way to get screen captures off the simulator.

Related Topic