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

后端 未结 4 1656
清歌不尽
清歌不尽 2020-12-02 06:17

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

4条回答
  •  情书的邮戳
    2020-12-02 06:34

    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
    

提交回复
热议问题