Build iPhone Apps for 2.2 and Earlier, Using Xcode 3.2 and Snow Leopard

Once you upgrade to Snow Leopard, you’ll notice a few things have changed as far as how to create builds for versions of the iPhone/iPod prior to 3.0. The changes are minor, however, I think you’ll agree that things have been simplified.

Let’s start with how to get your system working with Snow Leopard:

Install Xcode/SDK for Snow Leopard

  1. Install Snow Leopard from DVD
  2. Install Xcode 3.2 from Snow Leopard DVD
  3. Download and install iPhone SDK 3.0 for Snow Leopard from Apple Developer Connection

Once installed, upon opening a project you may see something similar to the following (which I received when opening a recent project):

Notice the reference to “iPhone Device 2.2.1 (missing)”. This project was built for 2.2.1 before I upgrade Xcode. On a similar note, if you open the dialog to set the device and distribution settings, here is how things will look:

Again, the references to earlier SDK’s are no longer available.

Targetging 2.2 or Earlier Version of iPhone SDK

The trick to targeting earlier versions of the SDK is now done through the Deployment section in the Build preferences. In the image below you’ll see a reference to iPhone OS Deployment Target along with a list of available OS target options.

Choose the target you need, clean, rebuild, and with that, you should be good to go.

16 Comments

  1. Thanks for the article. Worked like a charm. I like articles like this; short, sweet and with pictures.

  2. Deployment target and SDK version are not the same thing. If you set the 3.0 SDK, set the 2.2.1 deployment target and use 3.0 only features, it will compile fine with no warning (because you are using the 3.0 SDK) but may crash at runtime on 2.2.1.

  3. Cédric,

    Thanks for pointing this out. The take away here is, if you use only 2.x features in Xcode 3.2 you can use the approach mentioned above, no worries.

    If you use 3.0 features and set the Target to 2.x, your app may very well crash if attempting to access features from a 2.x device.

    The work around is to check for the availability of classes and methods you are interested in using. Apple offers some good tips here:

    http://developer.apple.com/mac/library/releasenotes/Cocoa/AppKit.html

    If anyone has other links/doc that provide more info, please post a comment.

    John

  4. I have the same problem with Xcode 3.2 on Snow Leopard. I’ve installed iphone sdk 3.0 but I can’t build app for iphone 2.0 -> 2.2.1
    I’ve lost previous framework and I can’t download it on dev center site!

  5. This solution worked for one of the projects I tested but not for the other.

    In the second project there is no option under deployment to set the “iPhone OS Deployment Target”.

    Any thoughts?

    • I think I’ve seen this before. Make sure you select the base SDK of 3.0, which I think should enable the option you are looking for.

  6. This XCode 3.2 + iPhone OS 2.2.1 configuration is a bag of hurt and

    I AM VERY HAPPY I MADE A BACKUP OF LEOPARD.

    So plug in that disk and reboot with 3.1, iPhone OS 2.2.1 and iphone simulator 2.2.1. That’s what I eventually did after loosing hours with that configuration.

    I f anyone finds how to revert an iPhone (not an iPod) to 2.2.1, this is a tip I would really pay some money for ;-)

  7. Wow. Even though I find this HUGELY counter-intuitive (Xcode’s overview button says “Device – 3.0 | Debug” even though I’m running the app on a 2.2.1 device), the tip worked for me as advertised, so I’ll run with it.

    Thank you for posting this! After restoring the various SDK folders from the Leopard backup and playing with the myriad choices of compilers with no joy, I had just about given up.

  8. Interesting … what if iPhone OS Deployment Target is MISSING under Deployment? One of my projects has it and the other doesn’t, yet both were created with Xcode 3.1.x. Odd. (Now on Xcode 3.2.3, using 4.0 as the Base SDK.)

  9. Interesting … what if iPhone OS Deployment Target is MISSING under Deployment?
    I have exactly the same problem???

    • The deployment target should be listed if you right click (or double-click) your Target. Choose the Build tab and search for “deployment target”

  10. Alas, it’s not. The deployment target is completely and utterly missing, even if I broaden the drop-down selections and eliminate all the search terms under Build.

    I ended up showing package contents for the xcodeproj file, backed-up and edited project.pbxproj, and compared it with that of a freshly made project.

    Seeing the differences, I went to my project’s XCBuildConfiguration section, and ensured these appeared in each buildSettings block:

    IPHONEOS_DEPLOYMENT_TARGET = 3.0;
    SDKROOT = iphoneos4.0;

    Problem solved! (I suggest this only be done as a worst case step. Always make backups!)

  11. i had the same problem. couldn’t find the “iphone OS deployment target”. i changed the Base SDK value from iPhone Device 3.2 to iPhone Simulator 3.2 and the deployment target showed up. I have no idea how that worked out since i’ve been working on mac only for a week now. interestingly enough, i tried switching back to iPhone Device 3.2 and the deployment target is still there. i didn’t understand the ‘how’ and ‘why’ part.. if any could explain.. thank you

Comments are closed.