Ghostboard pixel

How To Clean Up Your Xcode Installation?

How To Clean Up Your Xcode Installation?

If you are working on a lot of projects or you are using a lot of test devices, Xcode uses a lot of your disk space. In this post we will discuss how to clean up your Xcode installation.

The Xcode Folder

Xcode generates a lot of cached data. It’s located in the folder ~/Library/Developer/Xcode. Two subfolders are interesting: ‘DerivedData’ and ‘iOS device support’. You can only access the library folder inside the ‘Go’ menu in your finder when you are pressing the option key.

Derived Data

Inside the derived data folder Xcode generates subfolders for every project you are working on. These files are created at build time and are used to speed up the build process. These folders can become quite big though. Also when your Xcode shows some wired behaviour, it’s worth a try to clean up the derived data folder. However, delete just subfolders, not the whole ‘DerivedData’ folder!

iOS device support

Inside this folder, there are subfolders for every device that you connect to your Mac. For every iOS version a new one will be created. If you have been working some time with the same Mac, a lot of folders should be inside this directory. You can delete them and Xcode will create a new subfolder the next time you connect your device. As mentioned before, you should only delete the subfolders, not the whole ‘iOS device support’ folder!

Be careful

You should be careful though. In my experience it has never been an issue to delete the subfolders of ‘DervicedData’ and ‘iOS device support’. However, it’s always safer to move them to a temporary folder first. Then you can check out whether everything is still working or not. First when you are sure that everything is fine, you should delete these files permanently.

It’s also very dangerous to delete any other folder inside the Library folder! If the wrong files are missing, your MacOS installation can be damaged. In any case you should always have a recent time machine backup of your system before deleting any files.

Your projects should also always be pushed to a repository to prevent a possible loss of data.

Video

Resources

Title Image: @ Voyagerix / shutterstock.com