xcode-select: error: tool 'xcodebuild' requires Xcode

准备Handbrake的环境时,

./configure --launch-jobs=$(sysctl -n hw.ncpu) --launch

运行时,出现了以下提示:

xcode-select: error: tool 'xcodebuild' requires Xcode, 
but active developer directory '/Library/Developer/CommandLineTools' 
is a command line tools instance

这种情况是xcodebuild的路径不正确。

localhost:HandBrake Private$ xcode-select --print-path
/Library/Developer/CommandLineTools
localhost:Developer Private$ xcodebuild -showsdks
xcode-select: error: tool 'xcodebuild' requires Xcode, 
but active developer directory '/Library/Developer/CommandLineTools' 
is a command line tools instance

将路径切换到Xcode的目录下:

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

References:

https://handbrake.fr/docs/en/1.1.0/developer/build-mac.html
https://blog.csdn.net/woaizijiheni/article/details/50614062

你可能感兴趣的:(xcode-select: error: tool 'xcodebuild' requires Xcode)