xcode查版本xcodebuild -version

终端输入

xcodebuild -version

如果报错:

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

报这个错误的原因是xcode-select不在默认的路径
1.找到xcode-select的当前路径终端命令行

xcode-select --print-path

 

 

2.设置xcode-select到指定位置

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

xcode.app 存放在应用程序(/Applications/Xcode.app/Contents/Developer/   为指定的位置)

 

 

3.验证是否设置成功

xcode-select --print-path

 

 

再次输入xcodebuild -version

 

posted @ 2020-03-07 18:25  yimu-yimu  阅读(1368)  评论(0编辑  收藏  举报