Xcode Space Clean-Up
Free up space on your Mac by deleting excessive support files
This script is used to clean up the support files for building apps for each version of iOS and WatchOS on each device you have plugged in with Xcode open. Each set of files can be multiple gigabytes. This script can help free up dozens of gigabytes of storage. Be sure to quit out of Xcode and be prepared to reinstall Xcode if it will not open following the script.
Scenarios to use this script:
- Attempting to update Xcode and you receive the error:
There is not enough disk space to install this product.
- You have deleted Xcode in hopes it would create enough space to install it again.
- You need more space on your Loop-building computer and know you haven’t done this in a long time (or at all).
- You might be required to fully uninstall and reinstall Xcode after running this script.
Run Xcode Code Clean-up
- If Xcode is open, you must close it before running this script.
- Open Terminal
- Copy/Paste this code into Terminal all on one line and hit ENTER:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/loopnlearn/LoopBuildScripts/main/XcodeClean.sh)"
To see the commands, look at this link:
You can also run this by following the instructions on the Build Select page, but choose option 2 in Utilities.
Need Even More Space?
To clean up even more Xcode files, click on the Apple symbol in the upper left corner of your screen, then click on About This Mac/Storage/Manage, and highlight and then delete all but the most recent support files. Here are the “before” and “after” clean-up screenshots. There’s no need to worry if you delete too many support files, simply re-download Xcode.