並非升級或重裝後本來的插件被刪掉了,其實插件還在這個目錄~/Library/Application Support/Developer/Shared/Xcode/Plug-ins(注意:第一次安裝Xcode時候,沒有此路徑,須要先下載一個插件包,編譯一下才會建立此文件夾)。之因此插件失效,是由於每一個插件只供特定UUID的Xcode使用,更新後uuid改變,因而便不能正常使用。app
1.查看當前Xcode的uuidui
在終端執行defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID,會獲得一串 UUID 碼。可能你的Xcode不是你安裝的,而是直接拷貝別人安裝好的Xcode到你的應用程序中,那麼這個命令得不到Xcode的uuid.spa
另一種辦法也能獲得Xcode的uuid,在應用程序中找到Xcode,右鍵選擇顯示包內容,找到Info.plist文件打開找到DVTPlugInCompatibilityUUID對應的值就是咱們要的uuid插件
2.修改插件的uuid爲當前Xcode的uuidcode
找到這個目錄~/Library/Application Support/Developer/Shared/Xcode/Plug-ins,找到對應的插件,右鍵顯示包內容,找到Info.plist文件打開找到DVTPlugInCompatibilityUUIDs的項目,添加一個Item,Value的值爲以前Xcode的UUID,保存.
3.重啓 Xcode 以後會提示"Load bundle"、 "Skip Bundle",這裏必須選擇"Load bundle",否則插件沒法使用。若是又不當心點了Skip Bundle,那就刪掉你剛纔在插件plist文件裏添加的那行Item,而後重啓Xcode,而後再從新剛纔的那幾步。至此問題已經完美解決。那麼有人會問:若是不少個插件都失效,不想一個一個的改,有沒有快速的方法,有,請看下一步。ip
在終端不能用命令defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID獲得uuid的,此方法不適用。批量修改命令爲:it
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`