0

I notice when submitting a Universal app to the app store, there are various screen resolutions to support. I think iPhone/iPod: 320x460, 320x480, 640x960 and iPad 768x1024.

When I specify Universal app development in Xcode, the simulator has a resolution of 320x480. To view 768x1024 screen resolution, I can change the target setting to iPad, but how to test 320x460 and 640x960 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.

iPadDeveloper2011
  • 4,560
  • 1
  • 25
  • 36

1 Answers1

2

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.

Community
  • 1
  • 1
grahamparks
  • 16,130
  • 5
  • 49
  • 43
  • OK thanks. I think I see what is happening now. I don't have "iPhone 4" in the device menu--just "iPhone Retina". I guess my simulator version (4.2 (235)) must be old. Know any (better) way to get a screen capture off the simulator? – iPadDeveloper2011 Dec 12 '10 at 08:57
  • In a follow-up to this, I have tried to update my Xcode/simulator version but the installer just hangs. Looks like that is a separate issue though. – iPadDeveloper2011 Dec 16 '10 at 06:06
  • OK, I just downloaded the latest SDK from apple, and installed without a problem, but I still don't have iPhone 4 in the device menu on the simulator. I guess I'll start another thread about this. – iPadDeveloper2011 Jan 14 '11 at 04:56
  • @iPadDeveloper2011 The "iPhone 4" option was renamed "iPhone (Retina)" in the simulator (which I hadn't noticed when I posted my answer). – grahamparks Jan 14 '11 at 08:18
  • My Code: - (void)viewDidLoad { SCREEN_WIDTH=[[UIScreen mainScreen] applicationFrame].size.width; SCREEN_HEIGHT=[[UIScreen mainScreen] applicationFrame].size.height; NSLog(@"w:%f h:%f",SCREEN_WIDTH,SCREEN_HEIGHT); ...} displays "w:320.000000 h:480.000000" with the simulator set to iPhone Retina... ? – iPadDeveloper2011 Jan 23 '11 at 03:39
  • Please see http://stackoverflow.com/questions/4772647/simulator-iphone-retina-has-wrong-screen-resolution/ for related discussion, and a really, really helpful answer. – iPadDeveloper2011 Jan 24 '11 at 05:24
  • @graham, I've up-voted your answer. I still want to know "is there any way to get screen captures off the simulator (apart from command-shift-3 and cropping the resulting image)?" My guess is simply "No". This would be a useful feature because the app store wants me to include screen-shots on different devices (but I only have an iPad). Anyhow--this is holding me back from accepting your answer. – iPadDeveloper2011 Jan 25 '11 at 05:57
  • OK @graham, I improved your answer to the point where I thought I could accept it. – iPadDeveloper2011 Jan 26 '11 at 02:31