It seems that my Mac's hard drive is shrinking faster than I realize I'm saving files to the hard drive. therefore Hazel I make a rule in the . periodically delete unused files or back up to an external hard drive.
Recently, there was about 16GB left in the SSD of the MacBook, but it sometimes becomes 0 temporarily because of spotlight indexing, so a few days ago, spotlight indexing was removed from Apple Mail, and the hard drive seems to be secured. magicianTemporary files are cleaned with , and Hazel rules are created and cleaned.
But today, I unexpectedly secured about 70GB.
To start with, it is because Xcode cleans the archived files every time it builds.
After creating a new file with an existing file name in the Xcode project, there was a build error, and while looking for a solution, I found the ~/Library/Developer/Xcode/DerivedData directory, which was 62GB.
1. Clear ~/Library/Developer/Xcode/DerivedData
When I looked it up, it was said that all information about the build for each project is stored in this directory. So, there is a tip that it is good to delete this directory if the indexing of the project does not go well, but it seems that the problem is that it is just accumulating. If you delete this directory and build again, it will be recreated, so it seems to be okay to delete this directory in case of multiple projects.
I deleted this directory to get 62GB.
2. Clear ~/Library/Developer/Xcode/Archives
When I found it, I looked through the Xcode directories one by one, and there was also the Archives directory. It had information that could be debugged about what was released. This seems to be accumulated every time you archive in Xcode. I deleted this directory to get 8GB.
3. Clear ~/Library/Developer/Xcode/iOS Device Logs
There was 560MB here, and I deleted the log because I had nothing to look at.
4. ~/Library/Developer/Xcode/ iOS DeviceSupport Clear Unneeded Simulator
There was 8.64 GB here, and it turns out that there are simulators since iOS 5. I also deleted all the recent ones.
I cleared the Xcode directories to free up about 70GB. On a 256 GB SSD, 70 GB was a huge boon.
There were tips such as deleting the DerivedData directory when there is a problem when building and trying, but in my case, it was deleted to secure hard disk space.
Since you can't see it every time, Hazel made a rule so that this build folder is automatically deleted when it becomes more than 5 gigabytes.
If you need to secure hard disk space among those who use Xcode, it would be good to check how much space is in the ~/Library/Developer/Xcode/ directory.