Clean up the InstallerSandboxes directory I have the usual problem, the disk of my macbook is full. I have tried what people say, like empty the bin, restart in safe mode but none of that works. So I've ran a perl script with sudo which adds up file sizes and I found that the InstallerSandboxes folder is eating up most of my space. (It can be found on multiple locations, I suppose it's hardlinked.) It has a .PKInstallSandboxManager subdirectory which contains 4 subdirectories with names in format: SOME-UUID.activeSandbox they all have huge sizes: 16.42 GB, 18.72 GB, 18.76 GB and 29.27 GB, that adds up to 83.19 GB. All of them contain a Root/Application/Xcode.app so I suppose they are all related to Xcode which is installed and I have an /Application/Xcode.app too. I don't suppose all 4 of them is in use, how can I get rid of the three that is not in use?
I've originally added the question because I didn't have enough space to update XCode. I ended up removing then reinstalling it. But things have gotten worse, last time I uninstalled it and then I got the error that I can't reinstall it because there isn't enough space. So desperate times call for desperate measures, I have deleted the 4 directories mentioned in the question which gave me 30GB extra space. I did it with sudo an mc and mc reported it deleted around 1400000 files, it's ridiculous! So then I could reinstall XCode and it seems to be working without problems.
Edit:
To free up additional space go to About This Mac &gt; Storage &gt; Manage &gt; Developer. In there XCode Caches was 15Gb on my computer. You can delete it and the next time XCode runs it will recreate some of it but only a couple GBs.