The CocoaPods cache is the folder where CocoaPods keeps downloaded pod sources and specs so repeat installs are quick. It is safe to clear. Run pod cache clean --all, or delete the folder, and pod install fetches everything again. Your Podfile and Podfile.lock are not touched.
- Path
~/Library/Caches/CocoaPods- What it is
- Downloaded pod sources and specs reused across projects
- Typical size
- From hundreds of megabytes to several gigabytes on Macs with many iOS projects
- Made by
- CocoaPods
- Safe to delete?
- Safe to clear
- Comes back?
- Yes, pod install downloads what it needs again
What is in this folder?
When you run pod install, CocoaPods downloads each pod into this cache and copies it into your project's Pods folder. The cache saves time and bandwidth when several projects use the same pod.
The cache is separate from the Pods folder in your project and from the spec repositories under ~/.cocoapods.
Is it safe to delete?
Yes. Everything here can be downloaded again, and your Podfile.lock pins the versions you use. The trade-off is time: the next install downloads each pod once more. Do not clear it if you are offline or on a slow connection.
Old projects whose pods were removed from the registry may fail to install after clearing, so if you rely on an archived pod, keep it.
How do I clear it by hand?
- Close Xcode and stop any running
podcommand. - Run the command below. Without
--allit asks you to name a pod. - Run
pod installin a project to fetch what it needs.
pod cache list
pod cache clean --allPrefer the pod command to deleting the folder. Do not delete a project'sPodsfolder unless you are ready to runpod installagain.
How do I stop it growing?
It grows as you try new pods and versions. Clearing it a few times a year is enough.
How Clean House handles it
Clean House recognizes the CocoaPods cache as downloaded iOS libraries, made by CocoaPods, and marks it as something that downloads again. You see that in the Why card, and files go to the Trash first.