Xcode - xcode-select: error: tool 'xcodebuild' requires Xcode報錯解決方案


 

用mac 自帶的終端執行的命令,安裝安裝Vapor和toolbox

安裝指令:

macdeMacBook-Pro:~ mac$ curl -sL check.vapor.sh| bash

 

結果報這個錯誤:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
⚠️  We don't recognize your Command Line Tools version.

Open Xcode and make sure the correct SDK is selected:
👀  Xcode > Preferences > Locations > Command Line Tools

Expected: Xcode 8 or 9 (Any Build Number)
Current: 

📖  Visit our docs for step-by-step instructions on installing Swift correctly.
http://docs.vapor.codes

👋  or Join our Slack and we'll help you get setup.
http://vapor.team

 

看到這里發現是提示路徑不對

Open Xcode and make sure the correct SDK is selected:
👀  Xcode > Preferences > Locations > Command Line Tools

 

用這個命令切換到你正在用的Xcode安裝路徑下(需要輸入Mac密碼)

macdeMacBook-Pro:~ mac$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
Password:

 

 

macdeMacBook-Pro:~ mac$ curl -sL check.vapor.sh| bash
✅  Xcode 9 is compatible with Vapor 2.
✅  Xcode 9 is compatible with Vapor 3.
✅  Swift 4.1 is compatible with Vapor 2.
✅  Swift 4.1 is compatible with Vapor 3.

結果成功了!

為什么會出現這種錯誤呢,原來是我安裝了2個Xcode。所以,安裝了多個Xcode的時候,就要注意

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM