Skip to content

Instantly share code, notes, and snippets.

@jessesquires
Forked from neonichu/update_xcode_plugins
Last active April 4, 2016 20:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessesquires/a6d6b96429e71e5bebb3 to your computer and use it in GitHub Desktop.
Save jessesquires/a6d6b96429e71e5bebb3 to your computer and use it in GitHub Desktop.
Update DVTPlugInCompatibilityUUIDs for installed plugins
#!/bin/sh
# ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2
# ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3
# ID='AABB7188-E14E-4433-AD3B-5CD791EAD9A3' # Xcode 7b5
# ID='7265231C-39B4-402C-89E1-16167C4CC990' #Xcode 7.1.1
ID='F41BD31E-2683-44B8-AE7F-5F09E919790E' # Xcode 7.2
PLIST_BUDDY=/usr/libexec/PlistBuddy
function add_compatibility() {
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \
"$1/Contents/Info.plist"
}
function has_compatibility() {
$PLIST_BUDDY -c 'Print DVTPlugInCompatibilityUUIDs' \
"$1/Contents/Info.plist"|grep -q "$2"
return $?
}
cd "$HOME/Library/Application Support/Developer/Shared/Xcode/Plug-ins"
for file in `ls -d *`
do
if `has_compatibility "$file" $ID`
then
true
else
echo "Plugin $file is now compatible with the newest Xcode"
add_compatibility "$file" $ID
fi
done
@jessesquires
Copy link
Author

Find Xcode ID

/usr/libexec/PlistBuddy -c 'Print DVTPlugInCompatibilityUUID' "$(xcode-select -p)/../Info.plist"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment