Tools & releasesHistorical technical note

Restoring old Xcode plug-ins after a version update

Documents historical fixes for plug-ins that stopped loading after an Xcode update or an accidental Skip Bundles selection. It checks compatibility UUIDs, edits plug-in Info.plist files and resets the loading choice.

Original byline:许漠颜

Originally credited to 许漠颜; edited and archived by Bison.

Source listed in the original

English translation of the Chinese original, translated on . The article body uses automated translation; app descriptions, historical reading notes and video subtitles receive separate editorial checks. Original publication dates, attribution, code and version notes are retained.

Editor: Bison
Contributor: 许漠颜

“I am a beginner and have never written a plugin, so I do not know why plugins stop working after every update. Based on the required changes, I suspect different versions have different uuids. I compared Xcode 7.1 and 7.2, and their uuids were indeed different.”


Issues:
(1) Plugins stop working after an Xcode update.

(2) Accidentally selecting Skip Bundles instead of Load Bundles when restarting Xcode.

Issue (1): I am a beginner and have never written a plugin, so I do not know why plugins stop working after every update. Based on the required changes, I suspect it relates to different uuids for different versions. I compared Xcode 7.1 and 7.2, and their uuids were indeed different. However, the recent 7.2.1 update has the same uuid as 7.2, yet the problem remains. I therefore do not know whether uuid is actually the cause. If you know, please reply.

Issue (2): after configuring the uuid in the plugin's DVTPlugInCompatibilityUUIDs, restarting Xcode presents Load Bundles and Skip Bundles once. Naturally, selecting Skip Bundles leaves the plugin unavailable.

Solution to issue (1): first, open the terminal and enter:

defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID

to obtain the uuid. Then go to

~/Library/Application Support/Developer/Shared/Xcode/Plug-ins


directory, find the desired plugin, choose Show Package Contents → Contents → Info.plist, and add the obtained uuid under DVTPlugInCompatibilityUUIDs.

Solution to issue (2): similarly, obtain the Mac's uuid, remove the matching entry under DVTPlugInCompatibilityUUIDs, and add the uuid again.

Restarting Xcode should then restore the plugins. However, this method becomes troublesome when many plugins are installed.

Simpler approach: the first case occurs after updating Xcode. Open the terminal and enter

    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.plist DVTPlugInCompatibilityUUID`(注意的是我们在打开Xcode的情况下输入命令,然后重新启动Xcode)。


Simpler approach: the second case occurs after completing the first procedure but accidentally clicking skip bundles on restart. Open the terminal and enter


find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults delete {} DVTPlugInCompatibilityUUIDs


Then restart Xcode and run


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.plist DVTPlugInCompatibilityUUID`


command, then restart Xcode once more.

Explanation of the command line:


find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist 找到目录Plug-in下名字Info.plist的文件

-maxdepth 3 |寻找的范围是三层文件夹<br>

xargs -I{} 将得到的info.plist文件的集合复制给{}<br>

defaults delete {} DVTPlugInCompatibilityUUIDs 删除掉plist文件下的DVTPlugInCompatibilityUUIDs参数


defaults write {} DVTPlugInCompatibilityUUIDs -array-add ''在DVTPlugInCompatibilityUUIDs Array下添加key


defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID 获取Mac的uuid


Some explanations here may be inaccurate, but following these steps will restore the plugins.

You can also use defaults write, defaults read, and defaults delete to work with other files on the Mac.


Recommended reading: Preparing an iOS app for Apple Pay