如何将Xcode指向旧的SDK,以便可以用作“基本SDK"? [英] How to point Xcode to an old SDK so it can be used as a "Base SDK"?

查看:589
本文介绍了如何将Xcode指向旧的SDK,以便可以用作“基本SDK"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Mac的设置:

卷A :
OS X 10.8
Xcode 4.5或更高版本-10.6 SDK 不是可作为基本SDK

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

第二卷:
OS X 10.7
Xcode 4.3.3-10.6 SDK IS 可作为基本SDK

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

第C卷:
OS X 10.6
Xcode 4.2-10.6 SDK IS 可作为基本SDK

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

在第A卷上,我安装了Xcode 4.5,该版本未在构建目标的构建设置中包含10.6 SDK作为可用的基础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.

我在此硬盘上有一个单独的10.6卷和10.7卷-两者都安装了Xcode,并且都允许我在Xcode Build Targets的"Build Settings"(构建设置)中选择10.6 SDK作为基本SDK.

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.

我知道我在卷C上安装了10.6 SDK(在较早的Xcode安装中为/Developer/SDKs).

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

如何将卷A上的Xcode指向卷C上的10.6 SDK?

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

推荐答案

您需要向旧的SDK添加符号链接(通常比复制更容易).

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 .

这可以很好地回到10.5.除此之外,事情变得更加复杂...

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

虽然在Xcode的未来版本中没有承诺将支持该功能,但我已经与Xcode团队进行了交谈,他们似乎并不希望很快改变它.

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.

我个人经常将/path/to/old/SDK保留在名为/SDKs的顶级目录中.这样,每次升级时,都可以轻松修复所有问题.

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.

我有一个修订xcode 脚本,该脚本简化了每次重新应用此修订的过程Xcode升级.

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

更新:在现代版本的Xcode(7.3+)中,要使用旧的SDK,请在此处编辑MinimumSDKVersion:

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

这篇关于如何将Xcode指向旧的SDK,以便可以用作“基本SDK"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆