【发布时间】:2019-04-02 21:28:27
【问题描述】:
最近升级到最新版本的 MacOS,尝试使用 Git 时遇到以下问题。我知道这与未正确访问 Xcode 开发工具有关..
这就是正在发生的事情:
Mitchells-MBP:~ Mitch$ git
dyld: Symbol not found: _OBJC_IVAR_$_NSTextViewIvars.sharedData
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DVTDocumentation.framework/Versions/A/../../../../SharedFrameworks/DVTKit.framework/Versions/A/DVTKit
Expected in: /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
in /Applications/Xcode.app/Contents/SharedFrameworks/DVTDocumentation.framework/Versions/A/../../../../SharedFrameworks/DVTKit.framework/Versions/A/DVTKit
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
Mitchells-MBP:~ Mitch$ sudo xcode-select -switch /Library/Developer/CommandLineTools/
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools/'
Mitchells-MBP:~ Mitch$ sudo /usr/bin/xcode-select -switch /Library/Developer/CommandLineTools/
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools/'
Mitchells-MBP:~ Mitch$ sudo /usr/bin/xcode-select -switch /Library/Developer/
xcode-select: error: invalid developer directory '/Library/Developer/'
Mitchells-MBP:~ Mitch$ sudo xcode-select -switch /Library/Developer/
xcode-select: error: invalid developer directory '/Library/Developer/'
Mitchells-MBP:~ Mitch$
我不知道还能尝试什么……真的需要将一些东西上传到 GitHub。谢谢!
【问题讨论】: