How to delete Pods and clear CocoaPods cache on Mac

It’s safe to delete Pods on a Mac: the folder holds your dependencies’ source code and the project CocoaPods made for Xcode, and CocoaPods restores the same versions from Podfile and Podfile.lock. CocoaPods also keeps a shared cache of downloaded pods and spec repos, which on older setups take a lot of space. This guide covers all of it, and what to check if your team keeps Pods in Git.

MacWashing, System Junk: Xcode junk, user caches, installers and logs found, 22.83 GB ready to be cleaned
  1. Open MacWashing and choose System Junk in the sidebar.
  2. Click Start Scan.
  3. Look through what it found and click Clean. Anything debatable stays unchecked.

Free trial · macOS 14 or later

Can you delete the Pods folder?

Yes. Pods holds the source code of your dependencies and the Pods project CocoaPods made for Xcode. Keep Podfile and Podfile.lock: from them pod install restores the same versions.

CocoaPods recommends keeping Pods in source control, and some teams do. In such a project, deleting the folder shows up as changes in Git. Delete it there only if you no longer work on the project.

How to delete Pods

  1. Quit Xcode.
  2. In Finder, open the project folder and move the Pods folder to the Trash.
Finder, an iOS project folder: Pods selected next to Podfile and the workspace
  1. Empty the Trash.

When you come back to the project, run this in its folder. It downloads the pods again or takes them from the CocoaPods cache:

pod install

How to clear CocoaPods cache with pod cache clean

CocoaPods keeps a copy of every pod version it downloaded, shared by all projects. This command shows what is in the cache:

pod cache list

This one deletes the whole cache without asking. Your projects and their Pods folders stay. The next pod install of a pod that isn’t in a project yet downloads it again:

pod cache clean --all

To clear one pod, give its name, for example pod cache clean Alamofire. Without a name CocoaPods requires --all, so the whole cache is never cleared by accident.

Remove the old master spec repo

Spec repos are the lists of pods and their versions. Since version 1.8 CocoaPods reads them from a CDN, and its local copy is small. Macs that used CocoaPods before that may still keep the full master repo, which grew very large. This command lists the spec repos on your Mac:

pod repo list

Before removing it, check your Podfiles. If one has the line source 'https://github.com/CocoaPods/Specs.git', replace it with source 'https://cdn.cocoapods.org/'. Otherwise the next pod install downloads the whole repo again.

If master is in the list, this command removes it. Your projects stay, and CocoaPods uses the CDN instead:

pod repo remove master

With MacWashing, it’s one click

MacWashing, System Junk: Xcode junk, user caches, installers and logs found, 22.83 GB ready to be cleaned

System Junk in MacWashing lists the CocoaPods cache and spec repos under App Caches, and the Pods folders of projects you haven’t changed for 90 days under Project Dependencies. All of them stay unchecked, since downloading pods again takes time, so you decide. The caches of your other apps are cleared in the same pass.

Free trial · macOS 14 or later

Questions and answers

Will MacWashing delete my own files when it cleans?

No. It removes only what it can match to a known app or a known kind of junk, in places apps leave files; macOS and Apple’s files are never touched. Anything debatable is marked and stays unchecked until you decide.

What about apps that are open?

If an open app holds files being cleaned, MacWashing waits for it to quit or quits it at your request, and opens it again afterwards.

Is it free?

Yes, within the free trial: System Junk and the Uninstaller free up to 25 GB in total, with no account or card needed.

Is it safe to delete the Pods folder?

Yes, if you keep Podfile and Podfile.lock: pod install brings back the same versions. It needs the internet unless the pods are still in the CocoaPods cache.

What does pod cache clean --all delete?

Only the shared cache of downloaded pods. The Pods folders of your projects, your Podfiles and the spec repos stay.

Should I use pod deintegrate to delete Pods?

No. pod deintegrate removes CocoaPods from the Xcode project itself, for when you move off CocoaPods. To free space, deleting the Pods folder is enough, and pod install restores it.