Manual Cache Removal
-
Remove system caches: In Finder’s Go to Folder, type
/Library/Caches/
and delete unneeded files (be very careful here and avoid system-critical caches). -
Remove user caches: Go to
~/Library/Caches/
and delete the contents of folders for apps you want to reset. Note: Don’t delete the entire~/Library/Caches
directory itself, just its contents -
Empty Trash: After deleting, empty the Trash to actually free space.
Terminal-Based Cleanup
This wipes all user and most system caches. After running such commands, you may also want to clear DNS and I/O caches:
Other useful commands:
-
Empty Trash via Terminal:
rm -rf ~/.Trash/*
will clear your Trash (since trash files still consume space). -
Brew cleanup: If you use Homebrew, run
brew cleanup
to remove outdated formulae and cached downloads. -
Purge memory cache: On some versions,
sudo purge
can clear disk cache buffers (this mostly frees RAM, not disk space).
Developer-Specific Cleanup
Android Studio (Gradle)
Android Studio caches build data and Gradle artifacts which can grow very large. First, in Android Studio use Build → Clean Project or Rebuild Project. If issues persist, try File → Invalidate Caches / Restart to clear IDE caches. You can also delete the global Gradle cache. Close Android Studio, then in Terminal run:
Xcode
Xcode stores a lot of cache and build data. With Xcode closed, you can delete DerivedData, which includes build intermediates and indexes. In Finder, go to
~/Library/Developer/Xcode/DerivedData/
and delete its contents, or run:
This forces Xcode to rebuild projects from scratch. Next, clear Xcode’s own caches:
You can also remove old Device Support files in ~/Library/Developer/Xcode/iOS DeviceSupport/
Finally, Xcode Archives (your built app archives) can take tens of GB. Delete old archives via Xcode’s Organizer or simply remove ~/Library/Developer/Xcode/Archives/
folders directly. Note that after deleting DerivedData or caches, Xcode will run slower on first build as it reconstructs everything.
Application support is also another cache folder
Location : ~/Library/Application Support
$ rm -rf ~/Library/Application Support
Clean the dyld cache
To free up space, you can safely delete the contents of the dyld
folder. First, quit Xcode and all Simulators to avoid any file-in-use issues. Then use either Finder or Terminal:
-
Manual (Finder): In Finder, press Shift+⌘+G, enter
~/Library/Developer/Caches/dyld
, and press Enter. This opens the dyld cache folder. Select and move all subfolders inside to the Trash. (You may be prompted for your password if any files are locked.) Empty the Trash to reclaim space. -
Terminal: Open Terminal and run a disk usage check to confirm:
Using CCleaner for Mac
CCleaner is a third-party app that can automate cache cleaning across many apps. After downloading CCleaner for Mac from its official site, run the Clean or Health Check function. CCleaner scans for system junk and cache files (browser caches, log files, etc.) and lets you review them before deletion.