Xcode's plugin greatly enriches the functionality of Xcode, and with the Alcatraz, the management of plugins is also very easy!
Cause of the problem
Xcode's plugin is placed in the directory in the ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins
. Xcplugin format. With Show Content You can see that there is a info.plist in Xcplugin, one of which is Dvtplugincompatibilityuuids, and that is why the plugin failed.
Since Apple does not disclose information about plug-in development, here I can only guess the role of dvtplugincompatibilityuuids by naming with value: plug-ins through Dvtplugincompatibilityuuids To specify the version of Xcode that can run this plug-in . Therefore, the dvtplugincompatibilityuuids is stored in the Xcode version corresponding to Uuid,xcode when the loading control is launched, the current UUID with the plug-in info.plist The dvtplugincompatibilityuuids stored in the UUID array to match, if there is no match, indicating that the plug-in cannot run in this version of Xcode, the plug-in will be invalidated.
Solutions
The workaround is simple: Add the current version of the UUID to Dvtplugincompatibilityuuids. But plug-ins more (one and more) cases, a few open changes are very boring and inefficient, as "lazy" programmer, this time to use the command line, so that repetitive labor automation. The idea is to divide the command into two parts:
- The
find
info.plist file for all plugins is found in the plugin directory by command.
xargs
Use the command to "for loop" the search results from the previous step (as you can see), using the command to add the defaults write
current version of the UUID to dvtplugincompatibilityuuids for each info.plist file.
At this point, the problem comes, excavator technology ... No, how do I get the UUID of the current version of Xcode? First turn off Xcode, open Terminal, enter tail -f /var/log/system.log
, again open Xcode, you can see the following log information:
[MT] pluginloading:required plug-in compatibility UUID 9F75337B-21B4-4ADC-B558-F9CADF7073A7 for plug-in at path ' ~/Library/ Application Support/developer/shared/xcode/plug-ins/alcatraz.xcplugin ' not present in Dvtplugincompatibilityuuids
As you can see, the log information indicates the reason that Xcode failed to load the plugin and is able to see the current version of Xcode's UUID 9F75337B-21B4-4ADC-B558-F9CADF7073A7
. Of course there is a better way to get the UUID of the current version of Xcode: defaults read
read dvtplugincompatibilityuuid from the info.plist of Xcode by command.
The final command is:
1 |
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 ' |
Run the above command at the terminal to solve the problem of plug-in failure, in the plug-in Info.plist Dvtplugincompatibilityuuids can also see the new UUID.
The principle and repair method of plugin invalidation after Xcode upgrade