天天看點

mac git xcrun error active developer path 錯誤

一:情景:

在mac下使用git;xcode4.6的環境時,需要安裝command line tools ,但是在裝了xcode5之後,就不需要安裝command line tools了,預設已經內建了;但是我先裝了,xcode4.6後來又安裝了xcode5也就是,我mac上安裝了兩個版本的xocde但是在終端下使用git時,出現了錯誤如下:

二:錯誤

    xcrun: error: active developer path ("/Users/apple/Desktop/Xcode5.app/Contents/Developer") does not exist, use xcode-select to change

三:解決方法:

在終端下:

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

注:上面的xcode5.app根據情況,因為我的xcode安裝之後,改了名字叫xcode5是以這裡是,xcodee5.app如果你沒有攺,就是xcode.app

參考:http://stackoverflow.com/questions/9621706/how-can-i-resolve-error-no-developer-directory-found-at-developer