【发布时间】:2012-03-26 04:11:48
【问题描述】:
我刚刚将 XCode 升级到 4.3.1。 我正在使用脚本来构建(然后通过 Testflight 部署)我的应用程序。 但我现在收到此错误:
错误:在 /Developer 中找不到开发人员目录。运行 /usr/bin/xcode-select 更新开发者目录路径。
我的机器中没有 /Developer 目录:我该如何修复它?
【问题讨论】:
标签: xcode macos xcodebuild
我刚刚将 XCode 升级到 4.3.1。 我正在使用脚本来构建(然后通过 Testflight 部署)我的应用程序。 但我现在收到此错误:
错误:在 /Developer 中找不到开发人员目录。运行 /usr/bin/xcode-select 更新开发者目录路径。
我的机器中没有 /Developer 目录:我该如何修复它?
【问题讨论】:
标签: xcode macos xcodebuild
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
【讨论】:
xcode-select -print-path 仔细检查路径是否设置正确。
sudo port selfupdate更新MacPorts时收到此警告,完美解决!
你也可以这样做......
sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer
【讨论】:
你们回答的都是正确的。但是对于那些遇到以下错误的人来说是错过了一步:
错误:
"xcode-select: Error: Path "/Applications/Xcode.app/Contents/Developer" is not a directory."
缺少步骤:
Double click your xcode 432.dmg. Now don't double click the xcode.app to use it. Instead copy it /Applications folder and then open it from there to install xcode.
现在使用终端命令
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
就是这样。您的错误不会再次发生,并且 Filemerge 现在可以工作了。
【讨论】:
这为我解决了:
大多数情况下,当您安装了较新版本的 xcode 时会发生此错误。并且命令行工具尚未初始化。
要解决这个问题:转到 Xcode Preferences > Locations (tab) > 底部选项是命令行工具。请选择工具的 Xcode 版本。
示例(对于 Xcode 8.3.3):转到 Xcode Preferences > Locations (tab) > 底部选项是命令行工具。选择 Xcode 8.3.3 (7D1014)。
【讨论】: