forked from tangqiaoboy/xcode_tool
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathreload_xcode_plugin.sh
executable file
·32 lines (26 loc) · 1.29 KB
/
reload_xcode_plugin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# !/bin/sh
echo '
_/_/_/ _/ _/ _/ _/ _/
_/ _/ _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/ _/ _/_/_/_/
_/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/ _/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
_/ _/_/_/ _/ _/ _/_/_/ _/_/_/ _/ _/ _/ _/_/
'
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
ls=`defaults read com.apple.dt.Xcode | grep -o 'DVTPlugInManagerNonApplePlugIns-Xcode-[^\"]*'`
for x in $ls; do
echo "Try to rescue your Xcode" ${x##*-} "..."
defaults delete com.apple.dt.Xcode $x
if [ $? -eq 0 ]; then
echo "Ok"
else
echo "Err"
fi
done
if [ ! ${#ls[@]} -eq 0 ];then
echo "\nRescue Success!Restart your Xcode and choose 'Load Bundles' option!"
else
echo "\nError!Cannot find any config of Plug-ins in your Library!"
echo "You have been run the script maybe."
echo "Try to restart Xcode and check wheather it works."
fi