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

查看:36
本文介绍了如何将 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

B 卷:
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

在 Volume 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 作为 Base 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.

我知道我在 Volume 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).

如何将 Volume A 上的 Xcode 指向 Volume 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.

我有一个 fix-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天全站免登陆