Skip to content

Instantly share code, notes, and snippets.

@takatomo
Last active September 28, 2015 02:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takatomo/fe5bb0ffbce51fc5c608 to your computer and use it in GitHub Desktop.
Save takatomo/fe5bb0ffbce51fc5c608 to your computer and use it in GitHub Desktop.
【ShellScript】Add Compatibility to XcodePlugins
#!/bin/bash
# 使用するときはここのパスを追加したいバージョンのXcodeのパスに変更してください。
XCODE="/Applications/Xcode.app"
XCODE_ID=`find ${XCODE} -name Info.plist -maxdepth 2 | xargs -I{} defaults read {} DVTPlugInCompatibilityUUID`
PLUGINS=`find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3`
add_XcodeID() {
grep -c $1 "$2" >&/dev/null
if [ "$?" -ne "0" ]; then
defaults write "$2" DVTPlugInCompatibilityUUIDs -array-add ${XCODE_ID}
fi
}
export XCODE_ID
export -f add_XcodeID
echo "${PLUGINS}" | xargs -E\n -I{} bash -c 'add_XcodeID ${XCODE_ID} "{}";'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment