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

后端 未结 4 1622
清歌不尽
清歌不尽 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:20

    Solved by browsing to older version Xcode.App/Developer/platforms and copy the iOS 6.1 SDK into same folder of XCode 5.

    0 讨论(0)
  • 2020-12-02 06:24

    Why not just symbolic link the SDK's? "ln -s"? If that doesn't work there's going to be some plist hacking required.

    0 讨论(0)
  • 2020-12-02 06:28

    Wrong approach. You don't "point" Xcode at an SDK. Instead you will have better luck copying the SDK into the appropriate "SDKs" folder for the Xcode installation. In modern Xcode installations this is usually:

    Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

    Copy the SDK in there, quit and restart Xcode and see what you find.

    (reading the other answer here I think that symbolic linking might be an option if you are dead-set on keeping the original SDK elsewhere)

    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题