I have the following problem, in near future I will need to write a few not very complicated apps for iPhone. I do not currently own an iPhone, so I plan to purchase one for testing purposes. In short would iPhone 4 allow me to test apps written for older ios versions? Any pitfalls? Or would I have to purchase older phones/ipad to do the testing properly?
6 Answers
Yes, to perform a proper test you will need to test on the individual devices you are supporting. The documentation will tell you if the framework/API you are using is supported in the older iOS versions. I'm afraid there will be some subjective answers here as I am sure some apps end up running just fine across many versions with simulator testing. There are many factors to consider when looking at backwards compatibility (desired speed, memory usage, APIs, ...). You stated your app is "not very complicated" so you may be fine. I would test your application on as many devices as possible.
I should also make the distinction that there is a difference between "will it compile" and "does it perform as expected". You can use xcode to test whether the application is compatible by targeting and older version. Whether or not the application runs as desired will be discovered when testing on the specific devices.

- 6,205
- 3
- 26
- 31
-
1In general, my philosophy is to not advertise support for an OS version or class of devices unless I've tested on them. There are many subtle bugs that may only be exposed when running on older hardware or OS versions. For example, it is not obvious which frameworks to weak link to guarantee something built against the 4.x SDK will run on a 3.x OS, so I always need to test on an old device to see if anything breaks on launch. – Brad Larson Mar 02 '11 at 16:46
You can't run iOS 3 on iPhone 4, so you have to buy separate devices.
But if it is a new app I wouldn't consider to make it iOS3 compatible. Most users have upgraded to iOS4 already. And at the time your app is in the store there will be even less users running iOS3.
Sure, this will remove like 0,5% of potential customers. But you don't want to buy another device for 100$ if you can get only 10$ revenue from the 0,5% customers that run iOS3. And you have to test your whole app again, which will take a significant amount of time.
So you should consider to drop support for iOS3.

- 89,811
- 20
- 225
- 247
It will allow you to test apps which are targeted at older iOS versions, yes.
Performance differences to older iDevices like the 1st gen iPhone / iPod touch are quite significant however. So if your apps require expensive calculations or the like, I'd recommend buying an older, used device too to get a feeling for performance on that generation of hardware.
Note that if you need to make sure the apps you are about to develop will run on very old devices / iOS versions, you maybe need to do without some cocoa classes and methods which require more recent versions of iOS

- 8,980
- 4
- 50
- 82
-
On those older models, the slower processor isn't as big a constraint as the smaller amount of memory. Memory management is a GREAT big deal on 3g and older models. It's only a FAIRLY big deal starting with the 3gs generation. – Dan Ray Mar 02 '11 at 12:53
If you bought an iPhone 4 for testing purpose.. You're testing on the latest iPhone available in the market and that doesn't means your app is ready to target low-end device automatically.
Let's take a deep look: If you've designed an App that must look gorgeous and work right out of the box on iPhone 4, then you're probably making your app a Retina display compatible. That is like playing with 960x640 resolution screen.
Now, if you planned to target low-end device for eg, iPhone 3GS, then all you gotta do is to reduce the graphic assets size by half, as iPhone 3GS is 320x480
That's it! Your App is ready for the low-end device as well, in looks and feels perspective.
Now, let's look from deployment perspective. If you base SDK is 4.2.1 and you're targeting to devices which runs 3.3, then all you gotta do is to make sure you don't use latest libraries/classes which are introduced in iOS 4.2.1, as they won't be available to device which are running on iOS 3.3. If you take care of this part, your app is almost ready to ship out.
From Market perspective. I see all the great apps out there had made their deployment target as iOS 4.0 or later. That means, they are targeting to only devices which runs iOS 4.0 or later versions.
I think, you can try your build in low-end iPhone simulator after successful testing cycles ran on iPhone 4 device. :)

- 1,042
- 8
- 17
The iPhone is generally not backwards compatible. Sometimes methods, properties, classes etc. are added or older ones become deprecated. For testing, i would recommend that you have several devices with different iOS Versions depending on the target iOS Version you want to release.
Also check the the iOS Reference Library: Under "Availability" for each function etc. is noted since when it is Available

- 14,024
- 4
- 40
- 38
-
Just because a method is deprecated doesn't mean that applications using it that were built with an older version of the SDK will no longer run on a new OS version. In fact, Apple recognizes the SDK version that was used to build an application and even uses a compatibility mode so that bugs that applications relied on in older OS versions are still presented to them so they don't break in the new OS. For example, applications that relied on the 2.0 bug where `+imageNamed:` returned an overretained UIImage don't crash on 3.0 because the OS recognizes these older applications. – Brad Larson Mar 02 '11 at 16:41