Skip to content

Instantly share code, notes, and snippets.

@EkkoG
Last active April 25, 2016 00:03
Show Gist options
  • Save EkkoG/8b6a7a1f4b1dfeb92367 to your computer and use it in GitHub Desktop.
Save EkkoG/8b6a7a1f4b1dfeb92367 to your computer and use it in GitHub Desktop.
refresh Xcode plugins
#!/bin/bash
#获取当前版本Xcode的DVTPlugInCompatibilityUUID
UUID=$(defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID)
echo Xcode DVTPlugInCompatibilityUUID is $UUID
#遍历每一个Xcode插件,将UUID写入插件的兼容列表中
for MyPlugin in ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/*
do
UUIDs=$(defaults read "$MyPlugin"/Contents/Info DVTPlugInCompatibilityUUIDs)
echo $MyPlugin
if echo "${UUIDs[@]}" | grep -w "$UUID" &>/dev/null; then
echo "The plug-in's UUIDs has contained the Xcode's UUID."
else
defaults write "$MyPlugin"/Contents/Info DVTPlugInCompatibilityUUIDs -array-add $UUID
echo "Refresh the plug-in completed."
fi
done
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment