HowTo: Install iPhone SDK 2.0 – 3.1 for XCode 3.2
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.
- iPhone SDK 2.2.1
- iPhone SDK 3.0 with Xcode 3.1.3 – Leopard
- iPhone SDK 3.0 with Xcode 3.2 – Snow Leopard
- iPhone SDK 3.1 with Xcode 3.1.4 – Leopard
- iPhone SDK 3.1 with Xcode 3.2.1 – Snow Leopard
- iPhone SDK 3.1.2 with Xcode 3.1.4 – Leopard
- iPhone SDK 3.1.2 with Xcode 3.2.1 – Snow Leopard
- iPhone SDK 3.1.3 with Xcode 3.1.4 – Leopard
- iPhone SDK 3.1.3 with Xcode 3.2.1 – Snow Leopard
- iPhone SDK 3.2 Beta 4 with Xcode 3.2.2 – Snow Leopard
- iPhone SDK 3.2 Final with Xcode 3.2.2 – Snow Leopard
- iPhone SDK 4 Final with Xcode 3.2.3 – Snow Leopard
- iPhone SDK 4.0.1 with Xcode 3.2.3 – Snow Leopard
- iPhone SDK 4.0.2 with Xcode 3.2.3 – Snow Leopard
- iPhone SDK 4.1 with Xcode 3.2.4 – Snow Leopard
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.
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.
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.
Click on Continue and and you will get to the next screen similar to the one in the screen shot below
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.
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.
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.
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.
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.
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.
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.
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.

























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.
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
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/
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.
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
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
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.
Thanks for that info…
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.
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
Links give me access denied, did apple remove them?
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
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.
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
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.
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.
Steve,
Thanks for sharing, I’ve updated the post to reflect the additional SDK’s.
Chris
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.
When you are using Base SDK 4.2 you can still build for previous iOS versions by setting the build target.
Thanks for the excellent post! Solved my problem
Regards
Cool. I just want the xcode 3.2.4′s link. Thanks.
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.
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.
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, ))
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
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.
Hi, this links doesn’t works anymore.
Gep,
I’m not sure, the links come from Apple so maybe they are named incorrectly. I’ll have to double check.
Chris
Lukas,
I will double check and see if I can find new working links. Thanks for letting me know.
Chris
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.
Aarti,
Can you tell me what you see there? if you aren’t seeing a package folder there may be something else.
Chris
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
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
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.
hello Chris,
What should be the size of an iphone app when uploading it on app store?
Please reply soon.
Thank You.
Aarti
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
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,
Jeff,
What frameworks is Xcode claiming aren’t present?
Chris
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