If you have been working on iOS or macOS projects for any length of time, you already know how fast CocoaPods can consume disk space. Knowing exactly how to clear the CocoaPods cache — whether through the built-in CLI command or by deleting folders manually — can recover several gigabytes quickly and fix mysterious build errors caused by corrupted pod downloads. This guide covers both approaches for 2026, including Apple Silicon Macs running macOS Sequoia or the upcoming Tahoe release.
Why the CocoaPods Cache Grows So Large
Every time CocoaPods downloads a dependency it stores a compressed copy of the source in its local cache. The next pod install for any project on the same machine reuses that copy instead of fetching it again from the network. Over months of active development — updating pods, switching between projects, or testing new libraries — the cache accumulates versions you no longer need. On machines with several years of Xcode projects, it is not unusual to find 3–10 GB sitting in that one folder.
The cache also interacts with Xcode's own build artifacts. If you are curious about just how much DerivedData and related folders are claiming, the guide on why Xcode takes up so much space walks through the full picture.
Where CocoaPods Stores Its Cache
CocoaPods splits its on-disk footprint across two main areas:
~/Library/Caches/CocoaPods/— downloaded pod source archives and their checksums. This is the primary cache that the CLI manages.~/.cocoapods/repos/— the local clone of the CocoaPods spec repository (or CDN mirror). This grows separately and contains the index of all published pod specs.
On Apple Silicon Macs the paths are the same; there is no architecture-specific subfolder. Both locations live under your home directory and are user-writable, so no sudo is required to clean them.
CocoaPods Cache Folder Size Reference
| Folder | Typical size | Safe to delete? | Rebuilt automatically? |
|---|---|---|---|
~/Library/Caches/CocoaPods/ |
1–10 GB | Yes | Yes, on next pod install |
~/.cocoapods/repos/master/ |
300–600 MB | Yes | Yes, on next pod install or pod repo update |
~/Library/Developer/Xcode/DerivedData/ |
5–30 GB | Yes (forces full rebuild) | Yes, on next Xcode build |
Pods/ folder inside project |
50–500 MB per project | Yes (run pod install to restore) |
Requires manual pod install |
How to Clear the CocoaPods Cache Using the CLI
The cleanest, safest way to wipe the download cache is with the built-in pod cache clean command. Open Terminal and run:
-
Clear all cached pods at once:
pod cache clean --allCocoaPods will list every pod name it is about to remove and ask for confirmation. Type
yand press Return. The command removes every entry from~/Library/Caches/CocoaPods/but leaves your spec repos intact. -
Clear a single pod by name (when you only want to force a fresh download of one dependency):
pod cache clean AlamofireReplace
Alamofirewith the name of whichever pod you want to purge. Casing must match the pod name exactly. -
Verify the cache is empty:
pod cache listAfter a successful clean, this command should return no output or print an empty list.
The CLI approach is preferred because it respects CocoaPods' internal bookkeeping. If the cache directory contained a partially downloaded archive, the tool removes it cleanly rather than leaving a broken entry in the index.
How to Clear the CocoaPods Cache Manually
If the pod command itself is broken, or if you want to also remove the spec repo to force a completely clean slate, you can delete the folders directly in Terminal:
-
Remove the download cache:
rm -rf ~/Library/Caches/CocoaPods -
Remove the spec repository (optional — only needed if the repo is corrupt or you want to reset the pod index):
rm -rf ~/.cocoapods/repos -
Reinstall dependencies in your project:
cd /path/to/your/project && pod installCocoaPods will re-clone the spec repository (or use the CDN) and re-download only the pods your
Podfile.lockrequires. This can take a few minutes on first run.
Manual deletion is perfectly safe. CocoaPods treats the cache as expendable and always rebuilds it from scratch when it is missing.
Clearing DerivedData After a Pod Cache Wipe
After removing cached pods and running pod install, you may still see stale build artifacts in Xcode. A clean build usually resolves this, but if errors persist, clearing DerivedData is the next step:
- From Xcode: Product > Clean Build Folder (Shift-Command-K).
- From Terminal:
rm -rf ~/Library/Developer/Xcode/DerivedData
DerivedData can grow to tens of gigabytes across multiple projects. A tool like Crumb can audit all of these at once and show what is safe before you delete, which is useful when you want to target only old project artifacts without wiping everything.
Fixing Common Errors After pod cache clean
"Unable to find a specification for..."
This error usually means the local spec repo is out of date after the cache was cleared. Run pod repo update to pull the latest index from the CDN, then retry pod install.
Checksum mismatch warnings
If CocoaPods warns about a checksum mismatch for a pod, it means the cached archive does not match the expected hash. Clear just that pod's cache with pod cache clean <PodName> and run pod install again.
Slow first pod install after cleaning
This is expected. CocoaPods has to download every archive fresh. If your connection is fast, even a large dependency list usually finishes within five minutes. Subsequent installs reuse the rebuilt cache.
How Much Space Can You Expect to Recover?
The savings depend heavily on how long the machine has been active and how many projects it has served. A developer who has been working on iOS apps for two or three years can easily find 5–8 GB in ~/Library/Caches/CocoaPods/. Adding DerivedData to the sweep often pushes the total recovered space into the tens of gigabytes. If you want a broader view of where disk space is going across all developer toolchains — Node modules, Cargo artifacts, Maven local repo — the overview of cleaning up developer caches on Mac is a good companion read.
Running du -sh ~/Library/Caches/CocoaPods/ before and after gives you an exact measurement of what was reclaimed. On macOS Sequoia and later, System Information also updates the "Developer" category in About This Mac storage faster than in previous releases, so the change is visible within a minute of deletion.
Keeping the Cache Under Control Long-Term
Clearing the CocoaPods cache is not a one-time task. A few habits help keep it manageable:
- Run
pod cache clean --allafter finishing a project or switching away from a codebase for more than a few months. - Prefer the CDN source (
source 'https://cdn.cocoapods.org/') over the full master repo clone; it avoids the large~/.cocoapods/repos/master/folder entirely on modern CocoaPods versions. - Periodically audit
~/Library/Caches/as a whole — it accumulates caches from many tools beyond CocoaPods, including simulators, language servers, and package managers. - Set a quarterly reminder to review DerivedData size. Old targets and schemes you no longer build accumulate quickly across macOS major version upgrades.