How to point Xcode to an old SDK so it can be used as a "Base SDK"?

Todd Ditchendorf picture Todd Ditchendorf · Jul 11, 2012 · Viewed 49.3k times · Source

My Mac's Setup:

Volume A:
OS X 10.8
Xcode 4.5 or later - 10.6 SDK IS NOT available as Base SDK

Volume B:
OS X 10.7
Xcode 4.3.3 - 10.6 SDK IS available as Base SDK

Volume C:
OS X 10.6
Xcode 4.2 - 10.6 SDK IS available as Base SDK


On Volume A, I have installed Xcode 4.5, which does not include the 10.6 SDK as an available "Base SDK" in my Build Targets' Build Settings.

I have a separate 10.6 volume and 10.7 volume on this hard drive - both of which have Xcode installed, and both of which allow me to select the 10.6 SDK as a Base SDK in my Xcode Build Targets' Build Settings.

I know that I have the 10.6 SDK installed on Volume C (at /Developer/SDKs from an older Xcode installation).

How can I point Xcode on Volume A to the 10.6 SDK which lives on Volume C?

Answer

Rob Napier picture Rob Napier · Jul 11, 2012

You'll need to add a symlink to the old SDK (this is generally easier than copying).

cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
ln -s /path/to/old/SDK .

This works fine back to 10.5. Beyond that things get a little more complicated...

While there's no promise in future versions of Xcode that this will be supported, I've chatted with the Xcode team about it and they don't seem keen on changing it anytime soon.

Personally I often keep /path/to/old/SDK in a top-level directory called /SDKs. That way every time I upgrade it's easy to fix everything up.

EDIT: I have a fix-xcode script that simplifies re-applying this fix every time Xcode upgrades.


UPDATE: In modern versions of Xcode (7.3+) to use older SDKs edit MinimumSDKVersion here:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist