iPhone: Minimum OS, Deployment Target & Base/Active SDK

Okay I've managed to figure it out after much reading!

Basically, the Active SDK is just a build time override of the Base SDK. By default, when the Base SDK changes it automatically changes the Deployment Target to the same OS as the SDK. So when I wanted to build the app under the 3.1.2 SDK but have it run on 3.0 OS, I changed the Active SDK to 3.1.2, but that had automatically changed the minimum OS (deployment target). I saw this by looking at the Info.plist file in the package contents in my .app file.

So the best thing to do is to set the Base SDK to the latest SDK (currently 3.1.2) and then manually set the Deployment Target to 3.0 OS. Once the 2 are different then it will no longer automatically change.

However, this means that your app can install on a 3.0 device that may have 3.0, 3.1, or 3.1.2 SDKs. Therefore, any frameworks, methods or properties you use that are only available in SDKs greater than 3.0 you will have to use conditionally.

When you get around to building the app, ensure that that Active Target is set as the same as your Base SDK, e.g. Device 3.1.2. But remember to compile your app under Device 3.0, Device 3.1, and Device 3.1.2 just to check for compiler warnings. This will ensure that you don't have any code accessing methods/frameworks that don't exist in any SDKs down to your Deployment Target.

I hope this helps anyone who is in my position and couldn't find a simple explanation of how it all works.

The SDK Compatibility Guide was very useful and informative. However it took just a little extra figuring out for me to be comfortable with the concept and how everything works. This image from the guide is useful:

alt text
(source: apple.com)

Tags:

Iphone