Information Technology Reference
In-Depth Information
The SDK supplied with any version of Xcode includes support for older versions of the OS, up to some arbit-
rary limit. For example, the iOS 4.3 SDK can build projects that run under iPhone OS 3.0 and later, but not
iPhone OS 2.x and 1.x.
An often-repeated rule for selecting an SDK and deployment target is that you should always select the Latest
OS SDK (as described earlier) and the most ancient supported deployment target. In practice, beta development
complicates the requirements. Here's a more comprehensive guide:
Select the Latest OS SDK for all development builds. With a beta SDK, you can use this option to experi-
ment with new features.
If you have a beta SDK installed, select the current public release of the OS—the version before the cur-
rent beta—as the Base SDK for App Store distribution builds.
Not all beta SDKs include this previous version. If you've installed a beta SDK and find the current public
OS SDK is missing, you must use or reinstall a separate older copy of Xcode for distribution builds .
Don't try to create a final production build with a beta version of the OS until the beta SDK is upgraded
to a final GM (Gold Master) seed and Apple confirms this seed is suitable for production code. This usually
happens just before public release.
You can use a beta SDK for Ad Hoc test builds only if your testers have access to the equivalent beta ver-
sions of the OS for their devices. If they don't, which is often the case, select the previous public SDK as the
active SDK. You can give them access, but some assembly is required. For details, see the Creating App
Store and Ad Hoc builds section later in this chapter.
The Simulator supports various older versions of the OS. You can use this option to partially test code for
backward-compatibility.
You also can test compatibility on real devices, if you have them. If you need to, you can use Xcode's Or-
ganizer to downgrade newer devices to older versions of the OS for testing. (Don't do this on devices you
use personally; you're likely to lose data.)
Set the deployment target as low as possible, for maximum backward-compatibility. This gives users the
best chance of being able to buy and use your app.
A key point is that when you set the deployment target to an older version of the target OS, your code must test
for OS-dependent features. Figure 13.2 illustrates this graphically.
In the figure, your app can run on any device with iOS 4.0 or later. The latest features from the iOS 4.3 SDK
aren't available on devices with older versions of iOS, so your code must check they exist before it tries to use
them. Your code will of course compile with the iOS 4.3 SDK—but when the deployment target is set to sup-
port older version of iOS, it won't run reliably on a range of supported OS versions unless you include versions-
specific tests and code features.
Supporting multiple versions of an OS is non-trivial. It's also difficult to test in full. The only true test is to run
the code on multiple devices, each of which has a different version of the OS—or on a single device multiple
times, updating the installed OS each until every version has been tested.
NOTE
Search WWH ::




Custom Search