qq_tracker_code_advanced_default

HowTo: Install iPhone SDK 2.0 – 3.1 for XCode 3.2

47

Comodo

So… you’ve installed the latest SDK and XCode from Apple’s developer site only to find out that the only base SDK’s you are left to develop with are 3.2 and 4.0. What about if you have an iPhone 2G as your only development device? The iPhone 2G only goes up to iOS 3.1.3 and if you are stuck with the lowest base SDK of 3.2, you will not be able to push your apps to your iPhone.

This is exactly what happened to me. I downloaded the beta SDK for the 4.0 iOS when it came out. Little did I know that when you install that, it removes all SDK’s prior to 3.2.

Luckily for us, Apple is kind enough to keep previous versions of Xcode and their SDK’s available for download. Here is a list of available downloads.

You have to be logged into the Apple developer site http://developer.apple.com to download the above listed SDK’s. I downloaded the 3.1.3 Snow Leopard SDK since I already have 3.2 and 4.0 and 3.1.3 includes all of the above mentioned SDK’s as well as 2.0 and 2.1.

Once you’ve downloaded the SDK of your choice it should be in the form of a DMG, go ahead and mount that and open up the resulting volume. You should get something that looks like the image below.

iPhone SDK Volume

iPhone SDK Volume

At this point you will need to open up the Packages folder rather then running the installer because all we want are the SDK’s. When you open up the Packages folder scroll down a bit until you see the SDK’s. You should see something similar to the screen shot below.

Packages Folder

Packages Folder

You’ll see that there are device SDK’s and simulator SDK’s. You don’t have to install the simulator SDK’s if you don’t want to because all we are really after here is to be able to push our apps to an iPhone with an iOS earlier then 3.2. Double click on one of the iPhone SDK’s and you will be presented with an installer screen like the one below.

iPhone SDK Installer Screen

iPhone SDK Installer Screen

Click on Continue and and you will get to the next screen similar to the one in the screen shot below

iPhone SDK Installer Screen

iPhone SDK Installer Screen

On this screen you need to click on the drive you want to install the SDK to. In most cases it will be your primary Hard Drive. If you have your Developer tools installed on a different drive then you should select that one instead. Next you need to click on Choose Folder and you will be presented with a Choose Folder dialog similar to the screen shot below.

Choose Folder Dialog

Choose Folder Dialog

If you are like me and installed Xcode in the default location then you should have a developer folder in the root of your Hard Drive. Click on the Developer folder and then click choose. You will see a screen similar to the one below.

iPhone SDK Installer Screen

iPhone SDK Installer Screen

You can verify on this screen that you’ve selected the proper folder. It should have a blue circle around the Hard Drive and if you’ve picked the Developer folder it should say the following on the bottom “You have chosen to install this software in the folder Developer on the disk Macintosh HD. Click Continue and you will be presented with a screen similar to the below screen shot.

iPhone SDK Installer Screen

iPhone SDK Installer Screen

This is just a confirmation screen, from here you just need to click on Install. You may be prompted with a password screen. Enter your password to continue with the installation. You should see a screen similar to the one below.

iPhone SDK Installer Progress Screen

iPhone SDK Installer Progress Screen

Depending on the SDK you are installing this part can take up to 5 minutes to complete. When the installation is done you will be presented with a screen similar to the one below.

iPhone SDK Install Complete

iPhone SDK Install Complete

Click on close. At this time your installation of the SDK is complete. You can verify that the SDK installed successfully by launching Xcode. Once Xcode is launched open an existing project or start a new one and go to Project -> Project Settings. You should see a screen similar to the below screen shot.

Xcode Project Settings - General

Xcode Project Settings - General

Click on the drop down towards the bottom where you can choose your base SDK and if all went well you should see a screen similar to the below depending on which SDK you installed.

iPhone SDK's

iPhone SDK's

Pick your SDK of choice and enjoy. Hopefully this tutorial has helped someone with their project. I spent many hours the other night researching how I could install older version SDK’s and once I found an easy method I thought I would share it with the rest of the world. If for some reason you don’t see your SDK listed here then it may have been installed in the wrong folder. If you can’t get it working feel free to ask me for help. I’m always willing to help out a fellow developer.

Similar Posts:

VN:F [1.9.22_1171]
Rating: 9.5/10 (33 votes cast)
VN:F [1.9.22_1171]
Rating: +14 (from 14 votes)
HowTo: Install iPhone SDK 2.0 - 3.1 for XCode 3.2, 9.5 out of 10 based on 33 ratings
Be Sociable, Share!

Comments

47 Responses to “HowTo: Install iPhone SDK 2.0 – 3.1 for XCode 3.2”
  1. Chris S says:

    This works fine but when I try to build I get “error: stdarg.h: No such file or directory”. This is on the #include_next line in the sdk stdarg.h. The only suggested fix I’ve seen is to switch to gcc4.0, but that doesn’t help.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  2. Chris says:

    Chris,

    Have you tried changing to arm6 as the architecture. I have run across this error before, not sure what I did to fix it though.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
  3. Kyle Decot says:

    Any idea why I can’t test my app in the simulator. I installed both the iPhone & Simulator 3.0 but when I launch the simulator I get:

    “iPhone Simulator could not find the SDK. The SDK may need to be reinstalled.

    I’ve verified that it’s installed to: /Developer/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/

    VA:F [1.9.22_1171]
    Rating: 4.0/5 (2 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  4. No Way says:

    Just set the iPhone OS Deployment Target build setting. You are sending people down the wrong path with this nonsense.

    Didn’t it occur to you that Apple would never have prevented you from testing on OS 3.x?

    Did you think to ask someone who knows the answer?

    Did you think all 150,000 developers are doing what you suggest? Or maybe they are setting the iPhone OS Deployment Target as you are supposed to do.

    VA:F [1.9.22_1171]
    Rating: 2.3/5 (3 votes cast)
    VA:F [1.9.22_1171]
    Rating: -11 (from 15 votes)
  5. Hardik says:

    Chris,
    I tried out the links but it just takes you to the download page for iOS sdk 4 whereas I need to download sdk 3.1.3 for leo.
    Help would be great.
    Hardik

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  6. Chris says:

    Hardik,

    Apple must have either taken them down or changed the path. I will check into it and see what I can come up with.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  7. 0xced says:

    The URLs just need to be changed from http://developer.apple.com/iphone/… to http://developer.apple.com/ios/… You must not alter anything else.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: +3 (from 3 votes)
  8. Chris says:

    Thanks for that info…

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  9. Chris says:

    Yes, you are right, you can set your Base SDK to the current SDK you have installed and set your OS Deployment target to 3.1.2 for example. This method suggests that you should always work with the newest SDK, which I fully support by the way. I was only showing everyone how they could install a previous version of the SDK.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  10. Chris says:

    Kyle,

    Haven’t tested the previous simulators yet but it should run if you set the base sdk to whatever you currently have 3.2 / 4.0 / 4.1.

    Let me know if that works for you.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  11. Jake says:

    Links give me access denied, did apple remove them?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  12. Brian says:

    Tried using Simulator and it does not work. Also, this method isn’t really proper for testing on an older device. Simply change the iPhone OS Deployment Target build settings as the other commenter indicated and you can install on a 3.x device.

    Also, Apple will not accept any binary compiled with an SDK below 4.0 for iPhone.

    If you want to code for 3.x, try using compile time checking to alert any use of 4.0 only API calls:
    http://0xced.blogspot.com/2010/07/using-sdk-313-with-iphone-sdk-4.html

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: +1 (from 3 votes)
  13. SteveCaine says:

    I get the same “iPhone Simulator could not find the SDK. The SDK may need to be reinstalled.” error. It seems the only way to be sure your code works on iOS 3.x devices is to have a separate drive/partition with Leopard and the older Xcode and 3.x iPhone SDKs installed. Develop and test there, then copy to your Snow Leopard drive/partition, set the SDK to 4.x and Deployment Target to 3.x. Otherwise you’re playing Russian Roulette with code you write and test on an iOS 4.x install of Xcode.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  14. Chris says:

    Steve,

    0xced has a nice writeup on how to add some compile time checking

    Here is a link http://0xced.blogspot.com/2010/07/using-sdk-313-with-iphone-sdk-4.html

    Hope that helps, Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  15. SteveCaine says:

    Does anyone know where I can download an iPhone 4.0 SDK (probably requires I download the full Xcode/iOS SDK package)?

    I have 4.01, 4.02 and 4.1, but would like to add the 4.0 SDK as well to test/debug ALL iOS 4.x versions.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  16. SteveCaine says:

    Never mind. Found my answer here

    http://iphonesdkdev.blogspot.com/2010/04/old-versions-of-iphone-sdk.html

    It has working links to download the iOS 4.0 SDK (included in Xcode 3.23) as well as URLs for all the other iOS 4.x SDKs and Xcodes for Leopard and Snow Leopard. I’m downloading the 4.0 package now but haven’t tested the other URLs.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  17. Chris says:

    Steve,

    Thanks for sharing, I’ve updated the post to reflect the additional SDK’s.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  18. Doesn't work says:

    I have xcode 3.2.5 and sdk 4.2. I need to compile for 4.1 as well. I downloaded the 4.1 (3.2.4) and that DOES NOT contain a “packages” folder. I need the 4.1 sdk and xcode 3.2.5. Is there any way to accomplish this? God I’m getting sick of this apple junk.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  19. Chris says:

    When you are using Base SDK 4.2 you can still build for previous iOS versions by setting the build target.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  20. Thanks for the excellent post! Solved my problem :D
    Regards

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  21. Lyle says:

    Cool. I just want the xcode 3.2.4′s link. Thanks.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  22. Don't understand says:

    I don’t understand. I have xCode 3.2.4 installed which automatically installs the 4.2 sdk. The 4.2 sdk is the only option. I do not want to build using the 4.2 sdk as I want devices running iOS 4.1 to be able to run my software. The instructions provided on the site are not valid for the linked iPhone 4.1 sdk as there is no “packages” directory available when the .dmg is mounted. In addition, it does not appear that you can install multiple versions of xcode (and the associated sdk) on the same machine as the only install location option is “hard disk”. I really need to build using the 4.1 sdk and I need to use xCode 3.2.5 as my development device is iOS 4.2. I would much appreciate some guidance on this issue. iOS 4.2 has broken some of the functionality in my app, which is why I want to target iOS 4.1 and, thus, build with sdk 4.1. I don’t really want to build using sdk 4.2 and build setting 4.1 as a target. I want to build using the 4.1 sdk and targeting iOS 4.1 devices. Thanks for the help.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  23. Chris says:

    4.2 shouldn’t have broken any functionality… if possible you should try to go over your code and see what needs to be changed.

    The only thing I can think of at this point is uninstalling XCode and reinstalling but using the 4.1 install instead.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  24. simple-smart says:

    Hi Chris. I’m already new with iOS development. Currently I install XCode 3.2.5 & iOS SDK 4.2 final. But, as you seen, XCode allow test my applications only with 4.2 version of iPhone & iPad simulators. I download XCode 3.2.3 & SDK 4.0.2 to get ability of testing my application on 4.0 version of simulators. But when I mount dmg image & run installation , I can’t find Packages folder. Only PDF file with instruction & full installation of XCode & iPhone SDK. I try to run this installation program, get custom install & can’t see iPhone SDK as separate item. What can I do in this case?
    Tnks, ))

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  25. Chris says:

    simple-smart,

    The process isn’t perfect and buggy at best. If you want to test for stability of your app with an earlier version of iOS, you are better off purchasing an iPod Touch and loading the firmware that you want to test on it.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  26. Gep says:

    Hi Chris,
    Thanks a million for the clear guidelines!
    However, I am looking for the iOS 3.1.3 package (the one you mention in your example) and could not find it in the corresponding Snow Leopard distribution. Although the dmg’s name is iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__10m2003a.dmg, it only contains 3.1 and 3.1.2 (among the iPhone SDKs) in the Packages subdirectory. Am I missing something?
    Cheers, Gep.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  27. Lukas says:

    Hi, this links doesn’t works anymore.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  28. Chris says:

    Gep,

    I’m not sure, the links come from Apple so maybe they are named incorrectly. I’ll have to double check.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  29. Chris says:

    Lukas,

    I will double check and see if I can find new working links. Thanks for letting me know.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  30. Aarti says:

    hiii Chris,

    I m new in iPhone development.

    I have downloaded the “xcode 3.2.5 and ios sdk 4.2″ SDK. but i m not getting the “Package” folder to install SDK ios 4.2.
    Please help me out.

    Thanking in anticipation.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  31. Chris says:

    Aarti,

    Can you tell me what you see there? if you aren’t seeing a package folder there may be something else.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  32. Aarti says:

    Chris,

    Thank you for replying.

    i can only see the,
    1. “About xcode and ios SDK” pdf
    2. “Xcode and iOS SDK” .mpkg file

    and the third “Package” folder is missing.

    Aarti

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  33. Chris says:

    Aarti,

    The only thing I can think of is that Apple may have changed it. You should be able to run the Xcode and iOS SDK mpkg file though and install into a different folder.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  34. Aarti says:

    Chris,

    Can you provide me the steps and the link to install “Xcode 3.2.5 and iOS SDK 4.2 “.

    Please help me out as early as possible.

    Thanks.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  35. aarti says:

    hello Chris,

    What should be the size of an iphone app when uploading it on app store?

    Please reply soon.

    Thank You.
    Aarti

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  36. Chris says:

    aarti,

    There is no specific size but I believe that there is a 10 MB limit for users to be able to download your app via edge.

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  37. Jeff says:

    Just beginning iPhone dev… am a little confused about the packages folder–what do I install? I tried to build a few projects and it says I do not have the proper frameworks installed, so where in the install do I go to get the frameworks? Packages folder?

    Thanks,

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  38. Chris says:

    Jeff,

    What frameworks is Xcode claiming aren’t present?

    Chris

    VN:F [1.9.22_1171]
    Rating: 4.0/5 (1 vote cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  39. Carlos says:

    Hi Chris thanks for posting this. However, I was able to download, and install SDK , and simulator for 3.0 but when I open my current version of Xcode (3.2.5) for SDK 4.2, , I do not see those versions under the options to choose under the ‘Base SDK for All Configurations’ in the General tab for the Project Settings. Can I be missing something else? Thanks for your help

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  40. Techjunkie says:

    In Xcode 4.3.1 you can install “Base SDK:s” by choosing “more simulators” from the drop down menu. Then you can download and install all from 3.0 to 5.0.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  41. Mario says:

    Chris,

    I have followed you instructions on installing the SDK 3.1.3 with xcode 3.1.4. I was successful on installing the SDK yes i could see where i was and i was in the folder platform. But my problem was when i was trying to set the SDK on the project settings but i could not find the SDK. The only thing visible was the Mac 10.4 and 10.5 Please help me i am very eager to start developing

    Thanks
    -Mario

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  42. Purdy says:

    Very helpful article. Thank you for taking the time to write it!

    One thing you might want to mention though. On some of the SDKs (xCode 3.2.4 & iOS 4.1 for example) the Packages folder is hidden. Apply your favorite workaround to make it visible and follow the instructions from there. This tripped me up at first and I see from the comments I wasn’t the only one.

    Again, thanks for the article.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Trackbacks

Check out what others are saying about this post...
  1. [...] version of sdk has only latest version of iOS simulator but here you can download older [...]

  2. [...] can still download (from Apple!) and install a previous Xcode version or SDK (cf. here). Yes, you can install multiple Xcode versions, in different directories, i.e. put only one version [...]

  3. [...] HowTo: Install iPhone SDK 2.0 – 3.1 for XCode 3.2 | Chris Fletcher’s Blog [...]

  4. [...] can still download (from Apple!) and install a previous Xcode version or SDK (cf. here). Yes, you can install multiple Xcode versions, in different directories, i.e. put only one version [...]



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!