我在 macOS 12 (Monterey) 上使用 Xcode 13.1 附带的默认工具链。
$ sudo xcode-select -r
$ sudo xcode-select -p
/Applications/Xcode.app/Contents/Developer
Run Code Online (Sandbox Code Playgroud)
但我发现下面有两个SDK目录/Library/Developer/CommandLineTools/SDKs:
$ pwd
/Library/Developer/CommandLineTools/SDKs
$ ls -1
MacOSX10.14.sdk
MacOSX10.15.sdk
Run Code Online (Sandbox Code Playgroud)
我想知道它们是如何安装的?
我过去曾多次升级 macOS(以及 Xcode)。升级期间是否安装了这些 SDK?/Applications/Xcode.app/Contents/Developer/Toolchains但是既然xcode也升级了,那么它的目录下不应该包含最新的SDK吗?为什么需要在下面安装单独的副本/Library/Developer/CommandLineTools/SDKs?
另外,SDK和工具链是同一个东西吗?我以为是,但现在我不确定。我用谷歌搜索了这个但没有发现任何有用的东西。我发现一个苹果文档解释了可以通过Preferences -> Components在菜单中选择来查看 Xcode 中可用的工具链。使用这种方法时我什么也没看到,这似乎表明 MacOSX10.14.sdk 和 MacOSX10.15.sdk 在我的系统上不被视为(有效?)工具链?
或者 SDK 是否/Library/Developer/CommandLineTools/SDKs仅用于 macOS 开发,而 Xcode 中的工具链包含更多适用于 iOS、iPad 等的工具链?但如果是这样,为什么下面没有MacOSX11.0.sdk和MacOSX12.0.sdk /Library/Developer/CommandLineTools/SDKs?
我完全迷失了。感谢您的任何解释。
| 归档时间: |
|
| 查看次数: |
906 次 |
| 最近记录: |