如何使用'xcode-select'设置活动开发者目录以进行Qt安装?

10
我在尝试安装最新版的mac Qt (https://www.qt.io/)。但是当我尝试安装时,出现了错误。

您需要安装Xcode http://developer.apple.com/xcode。如果已经安装,请使用'xcode-select'设置活动开发人员目录。

我现在已经安装了xcode 7.3.1,然后在终端中运行了以下命令:
sudo xcode-select -switch /Applications/Xcode.app

但我仍然遇到相同的错误(见屏幕截图)。 enter image description here 有人能指导我如何解决这个问题吗?

可能是xcode-select active developer directory error的重复问题。 - JAL
3个回答

26

这个解决了我的错误。

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

这个答案来源于这里的回答:https://dev59.com/7GMl5IYBdhLWcg3w966L#17980786

我第一次点击"OK"后错误重新出现了。第二次点击后才被接受,安装继续进行。


0

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer 对我来说没有用,因为xcode-select仍然将目录标记为无效。 我通过以下方式创建了一个符号链接到homebrew的内部目标xcode dev工具目录:

sudo ln -s /Applications/Xcode.app/Contents/Developer /Library/Developer/CommandLineTools

在创建上述符号链接后重新安装homebrew对我有用。


截至2018年8月,内核版本为Darwin Kernel Version 18.0.0:Wed Aug 22 20:13:40 PDT 2018;root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64。 - A-Dubb

-5

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer


1
这是之前发布的答案的完全相同的回答:https://dev59.com/YJjga4cB1Zd3GeqPM6Lv#40390272,那个答案要好得多。请添加一些实质内容,如果您不能克制回答,请不要回答。 - rene

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接