仅安装命令行工具时如何获取当前MacOSX SDK的路径? [英] How to get the path to the current MacOSX SDK when only Command Line Tools are installed?

查看:110
本文介绍了仅安装命令行工具时如何获取当前MacOSX SDK的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试查找某些OSX机器(10.11)使用的当前平台SDK.在这些计算机上,仅安装命令行工具,而不安装完整的Xcode应用程序.

We are trying to locate the current platform SDK used by some of our OSX machines (10.11). On those machines, only the Command Line Tools are installed, not the full blown Xcode app.

在SO上查找,我们能够找到命令 xcrun --show-sdk-path ,它会打印出一个空行.

Looking up on SO, we were able to find the command xcrun --show-sdk-path, which prints out an empty line.

另一方面, xcrun --show-sdk-version 正确显示 10.11 .

是否可以找到我们的编译任务所使用的SDK的路径?

Is there a way to locate the path to the SDK used by our compilation tasks ?

推荐答案

如何

xcode-select --print-path

手册页上显示:

将路径打印到当前选定的开发人员目录.这对于检查很有用,但是脚本和其他工具应该使用xcrun(1)在活动开发人员中定位工具目录.

Prints the path to the currently selected developer directory. This is useful for inspection, but scripts and other tools should use xcrun(1) to locate tool inside the active developer directory.

在仅安装了命令行工具的Mac上,我得到:

On a Mac with only the command line tools installed I get:

/Library/Developer/CommandLineTools

和xcrun --show-sdk-path给我与您相同的空行.

and xcrun --show-sdk-path gives me the same blank line as you get.

这篇关于仅安装命令行工具时如何获取当前MacOSX SDK的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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