在新的OS X Mavericks升级后,git错误"无法找到xcodebuild"

tol*_*rob 37 git xcodebuild osx-mavericks

当我尝试运行以前工作的git命令时,我得到了这个:

dyld: Symbol not found: _sqlite3_intarray_bind
  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
  Expected in: /opt/local/lib/libsqlite3.dylib
 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

sus*_*prj 93

这适合我 sudo xcode-select --switch /Library/Developer/CommandLineTools/

  • 它对我不起作用。我得到`xcode-select:错误:无效的开发人员目录'/ Library / Developer / CommandLineTools /'` (5认同)

tol*_*rob 30

经过大量的谷歌搜索和混乱后,以下步骤导致解决方案(安装Xcode).有些可能是可选的,所以请随意详细说明,因为我不是这些错误的专家.

  • 下载mavericks命令行工具https://developer.apple.com/downloads/
  • xcode-select --install
  • sudo xcode-select -switch /Library/Developer/CommandLineTools
  • brew install sqlite3
  • DYLD_LIBRARY_PATH在我的.bashrc文件中注释掉了条目


小智 27

在 MacOS Mojave 上,这对我有用(git 2.21.0):

xcode-select --install
sudo xcode-select -switch /Library/Developer/CommandLineTools
Run Code Online (Sandbox Code Playgroud)


zdk*_*zdk 11

如果您已经安装了Xcode,则可以运行以下命令来确定并指向正确的位置

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
Run Code Online (Sandbox Code Playgroud)

或者使用AppStore安装最新的Xcode.


小智 9

xcode-select --install
sudo xcode-select -switch /Library/Developer/CommandLineTools
Run Code Online (Sandbox Code Playgroud)

这为我做到了。


ans*_*lla 6

最有可能需要在切换xcode路径以指向该位置之前重新安装命令行工具。

首先安装工具

$ xcode-select --install

这会将工具安装到该文件夹​​中/Library/Developer/CommandLineTools

然后将xcode路径指向工具的安装位置,如下所示

$ sudo xcode-select -switch /Library/Developer/CommandLineTools

注意:您可以使用命令查看当前的xcode路径$ xcode-select -p。我的最初指的是/Applications/Xcode.app/Contents/Developer我遇到错误的时间


小智 6

这在 MacOS High Sierra (10.13.6) 中对我有用

须藤 xcode-select --switch /Library/Developer/CommandLineTools/


ton*_*ton 0

也许您应该为 Mavericks 安装 Xcode 5.0.1。检查更新。