Mac Angular打包報錯:
Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Angular項目運行,打包需安裝環境如下:
1:安裝node(自己去官網下載指定版本安裝,Angular1.0這種過時的項目是不支持高版本node的),cordova,gulp等。
2:安裝xcode。
運行打包命令:gulp build:ios:release 報錯如上所述,由於我們在蘋果商店下載的程序安裝在Applications目錄,與/Library/Developer/CommandLineTools目錄不一致。
解決方案:
使用以下命令把 xcode 的路徑修改為你安裝的位置即可
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer