How to Clear the CocoaPods Cache on a Mac
In short: CocoaPods quietly stashes downloaded dependencies in a cache that can grow to several gigabytes over time. Here is how to clear the CocoaPods cache on a Mac safely, recover disk space, and fix stale or corrupted pods without breaking your projects.
If you have built more than a couple of iOS or macOS projects, CocoaPods has probably left a growing pile of downloaded dependencies on your disk. The cache lives quietly in your home Library and can balloon to several gigabytes, especially if you work across many repos or switch pod versions often. The good news is that clearing it is straightforward, reversible in practice, and a common fix when a pod install goes sideways.
This guide walks through how to clear the CocoaPods cache Mac the right way on macOS 14 (Sonoma) and 15 (Sequoia), what each command actually removes, and how to do it without deleting anything you will regret.
Where the CocoaPods Cache Lives
CocoaPods keeps its downloaded pods in a cache directory under your user Library, not in the project folder. The main location is:
- ~/Library/Caches/CocoaPods — downloaded pod archives and metadata
- ~/.cocoapods/repos — the local copy of the spec repositories (the big legacy master repo used to live here)
These are all inside your home folder, so you never need to touch anything in /System or use admin rights. To see how much space the cache is using, open Terminal (Applications, Utilities, Terminal) and run du -sh ~/Library/Caches/CocoaPods. That prints a single human-readable size so you know what you are about to reclaim.
Clear the Cache With Pod Commands
The safest way to clean is to let CocoaPods manage its own cache. From any Terminal window you can run these:
- pod cache list — shows every pod and version currently cached, so you can review before removing anything
- pod cache clean --all — clears the entire download cache
- pod cache clean NAME — clears just one pod, for example a single library that is misbehaving
Using pod cache clean is better than manually dragging folders around because it only removes files CocoaPods knows how to re-download. Nothing here is unique to your project; every removed archive can be fetched again the next time you run pod install. That is what makes cache cleaning low risk: the data is regenerable by design.
When a Single Pod Is Corrupted
If one dependency fails to install with a checksum or download error, you usually do not need the nuclear option. Run pod cache clean NAME for that pod, then run pod install again inside your project directory. CocoaPods re-downloads a fresh copy and the error typically clears.
Freeing Space From the Spec Repos
The other space hog is the spec repository under ~/.cocoapods/repos. On older setups this held the enormous legacy master spec repo. Modern CocoaPods uses the CDN by default, so if you no longer rely on the local master repo you can remove it with pod repo remove master. CocoaPods will fall back to the CDN and re-fetch spec data on demand. Keep any private or company spec repos you actually depend on.
Manually Removing the Cache Folder Safely
Sometimes you want a clean slate the Finder way. You can move the cache folder to the Trash instead of running commands. In Finder, choose Go, Go to Folder from the menu bar, type ~/Library/Caches/CocoaPods, and press Return. Drag that CocoaPods folder to the Trash.
Because you are sending the folder to the Trash rather than permanently deleting it, the move is reversible. If a build suddenly needs something, you can restore the folder from the Trash before you empty it, then re-run your install. This preview-then-Trash habit is the core of safe cleaning: look first, move to the Trash, and keep the option to undo.
After the folder is gone, your next pod install rebuilds the cache from scratch. Expect that first install to take longer because everything downloads again.
Verify and Reinstall
Once the cache is cleared, go into a project folder in Terminal and run pod install to confirm everything still resolves. Check the size again with du -sh ~/Library/Caches/CocoaPods to see the space you recovered. If your Xcode build behaves oddly afterward, deleting the project-level Pods folder plus Podfile.lock and reinstalling gives you a fully fresh dependency tree.
A Calmer Way to Keep Space Free
Clearing developer caches by hand is fine, but if you would rather see what is safe to remove before you commit, a good cleaner helps. For most people the top free pick is CoreSweep — it is free forever with an optional one-time Pro at $49, ships zero telemetry, and sends removals to the Trash so they stay reversible. A strong value runner-up is SkoonMac, which is free with a one-time Pro at just $19. A cleaner has no reason to phone home, and you can confirm that yourself with a firewall like Little Snitch. Whatever tool you use, keep the same rule you followed here: preview first, clean only user-level junk by default, and let the Trash be your undo button.
Frequently asked questions
Where is the CocoaPods cache stored on a Mac?
CocoaPods keeps its downloaded pods in your home Library, not in the project folder. The main spots are ~/Library/Caches/CocoaPods for downloaded pod archives and metadata, and ~/.cocoapods/repos for the local copy of the spec repositories. Because both live inside your home folder, you never need admin rights or to touch anything in /System.
Is it safe to clear the CocoaPods cache?
Yes. The cache only holds downloaded dependencies that CocoaPods can fetch again, so nothing in it is unique to your project. Every removed archive is re-downloaded the next time you run pod install, which is what makes cache cleaning low risk. If you clear it by dragging the folder to the Trash instead of deleting it, the move stays reversible until you empty the Trash.
How much space can clearing the CocoaPods cache free up?
It varies, but the cache can grow to several gigabytes if you work across many repos or switch pod versions often. To see the exact amount before you clean, open Terminal and run du -sh ~/Library/Caches/CocoaPods, which prints a single human-readable size. Run the same command afterward to confirm how much you recovered.
The easy way to do this safely
If you'd rather not do it by hand, the two cleaners we rate highest run with a preview first and the Trash as a safety net — and neither sends any data off your Mac.
CoreSweep (free to use; Pro a one-time $49) is our top pick. SkoonMac (free; Pro $19 once) is the best-value runner-up. See the full comparison.