What is the CocoaPods cache on Mac? Is it safe to delete?
Yes, the CocoaPods cache is safe to delete. It stores downloaded copies of pods, and CocoaPods downloads them again the next time you run pod install.
Where it is
~/Library/Caches/CocoaPodsWhat it is
When you run pod install, CocoaPods downloads each dependency once into ~/Library/Caches/CocoaPods and then copies it into your project's Pods folder. Other projects that use the same pod version reuse the cached copy.
It grows because every version of every pod you have used stays in the cache, including versions no current project depends on.
This is different from the Pods folder inside a project, which holds the copies that project actually builds with.
How big it gets
Usually hundreds of MB to a few GB.
How to clear it by hand
- Open Terminal.
- Run the command below. It removes every cached pod.
- To see what is cached before you clear it, run pod cache list.
pod cache clean --allWhat happens afterwards
Projects that already have their Pods folder keep building. The next pod install or pod update downloads the pods it needs again.
How Diskzy handles it
Diskzy lists the CocoaPods cache in the Clean up tab and ticks it. Pods folders inside projects are handled separately, as project build folders.
Related guides
- DerivedData~/Library/Developer/Xcode/DerivedData
- Xcode Archives~/Library/Developer/Xcode/Archives
- Caches~/Library/Caches
See where your Mac's space went
Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.
Try Diskzy for free