Is it safe to delete the /Developer folder on Mac OS X 10.7.5 (Lion)?
My computer originally had Mac OS X 10.6 (Snow Leopard) installed on it but has since been upgraded to OS X 10.7 (Lion). I noticed that the /Developer
folder is still on the hard drive even though none of its files appear to have been modified for nearly two years. Is it safe to delete /Developer
or is there some reason to keep it around?
Chris Rea's answer includes a link to a guide to uninstall Xcode, which seems to suggest that the contents of /Developer
are only used by versions of Xcode prior to 4.3. I have already installed Xcode 4.6 on my machine, so I should be able to remove /Developer
and everything under it. That being said, the following statement in the aforementioned guide puzzled me a bit.
sudo /Developer/Library/uninstall-devtools --mode=xcodedir
This command is basically a shortcut to the previously mentioned “/Developer/Library/uninstall-developer-folder” script. If you want to ditch the /Developer directory, run this command rather than manually deleting it through the Finder.
Why should I run this script instead of simply deleting /Developer
through the Finder?
This question is related, but I don't want to fully remove Xcode 4. I just want to remove all traces of Xcode that are not needed by the latest version.
Solution 1:
Yes, it looks like it should be safe to remove /Developer
if you have already installed version 4.3 or later of Xcode. The Xcode section of the Apple Developer Support Center actually tells you to do this (emphasis mine).
I've installed the latest version of Xcode from the Mac App Store, but a previous version of Xcode (4.2.1 or earlier) keeps launching. What should I do?
To run the latest version of Xcode, make sure you are launching Xcode.app from the Applications folder. Xcode 4.3 and later is packaged on the Mac App Store as a single application and installs in your Applications folder as Xcode.app.
Previous versions of Xcode placed the tools and frameworks in the Developer folder. You can delete the older version of Xcode by dragging the Developer folder to the trash.
Furthermore, as pointed out by bispymusic, /Developer
no longer exists with Xcode 4.3. Specifically (emphasis mine):
The simplification afforded by repackaging Xcode 4.3 as a single app bundle eliminates the need for the
/Developer
directory containing prior versions of Xcode. As a result, the Install Xcode application and theuninstall-devtools
command line script are also no longer needed.Note: The first time you run Xcode 4.3, you are prompted with a dialog to delete the Install Xcode application from the Applications directory if one is resident, and to remove any older installation of Xcode (Figure 4). These actions are optional, Xcode 4.3 can co-exist with older installations of Xcode on the same Mac. Some operations may require an administrator password to enable them if you switch from one version of Xcode to another.
Figure 4 Option to remove older versions of Xcode
If you choose not to delete these items on the first launch of Xcode 4.3, you can remove the
/Developer
folder and the Install Xcode application by dragging them to the Trash at any time.
Solution 2:
Did you already upgrade your Xcode to a newer version, one stored under /Applications
? If you upgraded to a newer Xcode stored in the new location and also installed the updated Command Line Tools from within Xcode, then what you have under the root /Developer
folder is likely all stale and you can probably safely delete /Developer
. To be safe, archive the folder elsewhere for the time being, then nuke it later when you are confident you don't need it.
If you did not install the more recent Xcode, I'm guessing the contents under /Developer
may still be "in effect." Have a look at this guide to uninstall the developer tools in that case. Make sure your environment variables don't refer to any paths within the folder.
Solution 3:
If you have Xcode 4.3 or later, it should be safe to remove this file. Apple elaborates on it here:
What's New in Xcode