Language toolchains & SDKs

How to Clear the CocoaPods Cache in 2026 (pod cache clean --all + Manual)

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:

  1. Clear all cached pods at once:

    pod cache clean --all

    CocoaPods will list every pod name it is about to remove and ask for confirmation. Type y and press Return. The command removes every entry from ~/Library/Caches/CocoaPods/ but leaves your spec repos intact.

  2. Clear a single pod by name (when you only want to force a fresh download of one dependency):

    pod cache clean Alamofire

    Replace Alamofire with the name of whichever pod you want to purge. Casing must match the pod name exactly.

  3. Verify the cache is empty:

    pod cache list

    After 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:

  1. Remove the download cache:

    rm -rf ~/Library/Caches/CocoaPods
  2. Remove the spec repository (optional — only needed if the repo is corrupt or you want to reset the pod index):

    rm -rf ~/.cocoapods/repos
  3. Reinstall dependencies in your project:

    cd /path/to/your/project && pod install

    CocoaPods will re-clone the spec repository (or use the CDN) and re-download only the pods your Podfile.lock requires. 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 --all after 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.

Reclaim your disk in one click

Crumb audits your whole Mac, tells you what's safe to delete, and frees the space in seconds — private, local, and Apple-notarized.

Download Crumb for macOS

Frequently asked questions

Is it safe to run pod cache clean --all?
Yes. The CocoaPods cache at ~/Library/Caches/CocoaPods/ is entirely expendable. Deleting it does not affect your project's Podfile or Podfile.lock. The next pod install simply re-downloads the required archives and rebuilds the cache automatically.
Where exactly is the CocoaPods cache on a Mac?
The download cache lives at ~/Library/Caches/CocoaPods/. The spec repository index is stored separately at ~/.cocoapods/repos/. Both are under your home directory and do not require administrator privileges to delete.
Will clearing the cache break my current Xcode project?
No. Your project's Pods/ folder and Podfile.lock are not touched by pod cache clean. The project continues to build normally using the already-installed pods. Only a fresh pod install will touch the project folder, and even then it follows your locked versions.
How much space does the CocoaPods cache typically use?
It varies by how many projects and pod versions you have accumulated, but 2–8 GB is common on a machine that has been active for a year or more. Running du -sh ~/Library/Caches/CocoaPods/ in Terminal shows the exact size before you delete anything.
Do I need to clear the spec repo (~/.cocoapods/repos/) as well?
Usually not. The spec repo is the index of all available pods and is only needed if it becomes corrupt or you see stale version data. If you do delete it, CocoaPods re-clones or re-fetches it automatically on the next pod install or pod repo update.