Last active
April 25, 2016 00:03
-
-
Save EkkoG/8b6a7a1f4b1dfeb92367 to your computer and use it in GitHub Desktop.
refresh Xcode plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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