If you use Mac for a long time, applications occupy the hard disk while creating cache or backup data. In addition to deleting by clean applications, if you can see and delete the directory contents, you can delete them to secure space.
Since the hard disk space of Mac seems to be running out again, I tried to organize the directories that can be deleted while erasing the ones that can be deleted before organizing the files.
- It takes up a lot of disk space because of the attachments rather than the message body. It is recommended to delete unused attachments or disable automatic download of attachments in the first place.
- Delete attachments opened in Apple Mail: ~/Library/Containers/com.apple.mail/Data/Library/Mail Downloads/
- Disable automatic download of attachments, remove unedited files when closing mail, clear all attachments you have already received: Clear Attachment Cache in Apple Mail
- This is the directory where applications cache. In my case, it was over 20 GB, so I boldly deleted it all. There may be some that do not work for each application, so it may be necessary to make a backup and delete them one by one to see if they work well.
iTunes sync backup files
- ~/Library/Application Support/MobileSync/Backup
- This is the directory where backup files are saved when syncing to iPhone or iPad with iTunes. Backups are created for each folder, so you can view the date and delete the most recent backup.
For Xcode Developers
- ~/Library/Developer/Xcode/DerivedData : Project index or compiled intermediate stage files are stored, so even if you delete them, Xcode will recreate them if necessary.
- ~/Library/Developer/Xcode/Archives : Files for app distribution are saved, find and delete unnecessary files
- ~/Library/Developer/Xcode/iOS Device Logs: Delete the log if you do not want to view it
- ~/Library/Developer/Xcode/ iOS DeviceSupport : Delete any unnecessary simulators. Each simulator is about 1-2 GB.
- Free up Mac hard space by cleaning Xcode filesalso laid out
The above article was written in 2015, and it is also valid for macOS 12.