xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve

在运行脚本的时候遇到一个问题,报错"

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

"

在网上查找资料,最后根据http://blog.csdn.net/woaizijiheni/article/details/50614062这篇博客终于解决,仅以此记录一下自己遇到的问题

1. 执行运行脚本的命令:报错如下“

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

2. 执行“

xcodebuild -showsdks

”,报错如下“

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

3. 执行“

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

”切换到当前Xcode路径下

4. 执行"

 xcodebuild -showsdks

":xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve_第1张图片


xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve_第2张图片


5. 执行"

xcrun --sdk iphoneos --show-sdk-path

"

结果“

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk

6. 运行脚本命令成功

        

你可能感兴趣的:(xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve)