并非升级或重装后本来的插件被删掉了,其实插件还在这个目录~/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`