24

I have multiple versions of Xcode installed. I can build my project against older iOS versions by launching old Xcode. But how could I use newer Xcode versions to build against older iOS versions?

In the project settings there's a Base SDK dropdown. It only offers the very latest iOS version for selection.

Under /Developer/Platforms/ there is an iOS.platform folder which contains this:

SDKs/
  iPhoneOS3.2.sdk
  iPhoneOS4.1.sdk

And finally, there is an interesting folder called DeviceSupport, which contains a whole bunch of versions ranging from 3.0 to 4.1!

There must be a way to copy SDKs / DeviceSupport files from old Xcode to new Xcode and make the older ones like iOS 4.0 or even 3.0 working. How?

openfrog
  • 40,201
  • 65
  • 225
  • 373
  • Here is a very helpful thread on this, especially for Xcode 4 users on OS X Lion: http://stackoverflow.com/questions/7459399/ios-simulator-only-list-the-latest-ios-version-how-can-i-set-earlier-versions – Jan Sep 27 '11 at 11:56

3 Answers3

24

To make an application target that runs on multiple versions of iOS is relatively simple: Set the “Base SDK” in your projects settings to the newest version number of iOS whose features you may want. Set the “iPhone OS Deployment Target” to the oldest version number of iOS that you will support

you will need to install older versions of xcode since the newer simulator will only support the newer ios versions

http://developer.apple.com/library/mac/#documentation/Xcode/Conceptual/XcodeCoexistence/Contents/Resources/en.lproj/Details/Details.html

jesper
  • 227
  • 3
  • 9
Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80
  • 1
    if you have older SDKs you can drop them into {Xcode_Path}/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ I copied my old (4.1, 4.2, 4.2, 5.0) SDKs when I updated Xcode (as the Xcode updates only have the latest SDK), and I pasted them back into this folder and I can now simulate older SDKs onto the same iOS Simulator. You still must install older Xcode's to get access to the older SDKs but once you have that you can remove the old Xcode. – Daniel Apr 14 '12 at 17:31
4

This became harder in Xcode 3.2.5 (iOS 4.2.1) as the separate "Base SDK" values for Device and Simulator are replaced with a single "iOS SDK".

See my post in Xcode/Simulator: How to run older iOS version? for details on how to access older Simulator SDK versions in this latest Xcode.

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
SteveCaine
  • 512
  • 4
  • 13
0

I think you should always build using the latest SDK and just set the deployment target to the appropriate version. To ensure your app runs correctly, check everything carefully on all versions and besides check the documentation if the APIs you are using have changed / removed / been deprecated in the different versions of the SDK!

cschwarz
  • 1,195
  • 11
  • 24
  • 4
    It's worth building against older SDKs to catch those cases where you've used a newer API call that doesn't exist in an older SDK. These become compile-time errors instead of run-time exceptions, much easier to debug. – SteveCaine Aug 10 '11 at 18:03