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


運行xcode命令報錯:

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

直接百度錯誤提示信息找這篇貼子

博主找到的原因是:

升級Xcode后,不是系統默認位置。我想我是直接安裝最新版的xcode應該也是這樣的問題。

 

解決的辦法是:

修改xcode指向的目錄 

xcode-select -s /Applications/Xcode.app/Contents/Developer

再次執行xcodebuild就可以正確執行了

1 sh-3.2# xcodebuild
2 note: Using new build system 3 note: Planning build 4 note: Constructing build description 5 Build system information 6 error: Signing for "HelloWorld" requires a development team. Select a development team in the project editor. (in target 'HelloWorld') 7 8 ** BUILD FAILED **

我這邊build failed是因為還沒有配置開發者賬號

 

by the way 查看xcode安裝目錄的命令:

這是在未修改xcode命令指向新目錄前,是系統默認的位置 

sh-3.2# xcode-select --print-path
/Library/Developer/CommandLineTools

這是修改后,再次查看,xcode命令指向xcode的安裝目錄已經變了 

sh-3.2# xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

 


免責聲明!

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



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