Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@DaveWoodCom
Last active September 8, 2023 21:02
Show Gist options
  • Star 43 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save DaveWoodCom/4488e485f14ab09d13d6 to your computer and use it in GitHub Desktop.
Save DaveWoodCom/4488e485f14ab09d13d6 to your computer and use it in GitHub Desktop.
Script to fix Xcode 6.x so that it will run on El Capitan
#!/bin/bash
## Copyright (C) 2015 Cerebral Gardens http://www.cerebralgardens.com/
##
## Permission is hereby granted, free of charge, to any person obtaining a copy of this
## software and associated documentation files (the "Software"), to deal in the Software
## without restriction, including without limitation the rights to use, copy, modify,
## merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to the following
## conditions:
##
## The above copyright notice and this permission notice shall be included in all copies
## or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
## INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
## PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
## HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
## CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
## OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
if [ $# -lt 1 ] ; then
echo "Usage: ${0} path/to/xcode.app"
exit
fi
XCODEAPP=${1}
if [ ! -e "${XCODEAPP}/Contents/MacOS/Xcode" ] ; then
echo "Error: ${XCODEAPP} does not look like a path to Xcode.app"
exit
fi
if [ ! -w "${XCODEAPP}/Contents/_CodeSignature/CodeResources" ] || [ ! -w "${XCODEAPP}/Contents/Info.plist" ] ; then
echo "Error: Permission denied, try running with sudo"
exit
fi
echo ""
echo "Please note: Apple may reject apps built with Xcode 6.x on El Capitan,"
echo "so even though this lets you run Xcode 6.x, make sure you use Yosemite"
echo "for your final App Store build. There are also reports that Xcode 6"
echo "may make corrupt builds on El Capitan, so your milage may vary."
echo ""
echo "Processing...This can take a few minutes to complete..."
echo ""
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion 8000" "${XCODEAPP}/Contents/Info.plist"
codesign -f -s - "${XCODEAPP}/Contents/MacOS/Xcode"
echo ""
echo "Looks like you should be good to go now."
echo "Why don't you also check out my app Watchdog For Xcode. It monitors Xcode"
echo "and solves all your DerivedData issues: http://bit.ly/WatchdogForXcode"
echo "Also, if you're developing with Swift, check out my debug log library"
echo "XCGLogger: https://github.com/DaveWoodCom/XCGLogger"
echo ""
@gaharrington
Copy link

Just happened to land on this page and read your echo above for Watchdog. Two days ago a wasted about an hour on a stale DerivedData problem...so glad I found your app...just purchased!

Thanks!

@manish-algoworks
Copy link

After running the script get this Usage: fixXcode6OnElCapitan.sh path/to/xcode.app but still not able to run xcode 6.4.

@ispeedyg
Copy link

ispeedyg commented Oct 7, 2015

Do I put this file inside the contents of that Xcode on my computer. Since I have renamed it away from plain Xcode.app? then just run sudo fixxcode6onelcapitan.sh from the terminal in that folder?

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