xcode插件的管理真的很讓人受傷鞭铆,升級xcode后莫名的不能用搞莺,查找資料后找到解決方案:
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth3| xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaultsread/Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID`
原理是:
Xcode 的插件放置在~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins目錄下主穗,為 .xcplugin 格式温算。通過 Show Content 可以看到 xcplugin 中存在一個 Info.plist扣草,其中有一項為DVTPlugInCompatibilityUUIDs胆绊,而這就是插件失效的原因氨鹏。
由于 Apple 沒有公開插件開發(fā)的相關(guān)資料,這里我只能通過命名跟值猜測 DVTPlugInCompatibilityUUIDs 的作用:插件通過 DVTPlugInCompatibilityUUIDs 來指定能夠運行此插件的 Xcode 版本压状。因此仆抵,DVTPlugInCompatibilityUUIDs 中存放的是 Xcode 版本對應的 UUID跟继,Xcode 在啟動加載控件時,將當前 UUID 同插件 Info.plist 中 DVTPlugInCompatibilityUUIDs 存放的 UUID 數(shù)組進行匹配镣丑,如果沒有匹配項舔糖,說明此插件無法在該版本的 Xcode 運行,插件也就失效了莺匠。
引用:http://joeshang.github.io/2015/04/10/fix-xcode-upgrade-plugin-invalid/
但是執(zhí)行上述命令后金吗,有些插件還是不好使,不知道是不是安裝多個xcode沖突造成的趣竣,
最后沒有辦法我只好clone插件到本地摇庙,運行下。
如果有人解決了上述問題 可以分享下經(jīng)驗遥缕。