---
id: mac-storage-basics.how-do-i-clean-cocoapods-and-swift-package-caches
url: https://storagestudio.us/faq/mac-storage-basics/how-do-i-clean-cocoapods-and-swift-package-caches
category: "Mac storage basics"
subcategory: "Developer tools"
question: "How do I clear CocoaPods and Swift package caches?"
alt_questions:
  - "cocoapods cache clean"
  - "swift package manager cache mac"
  - "spm cache location"
  - "pod cache clean all"
  - "xcode package cache size"
short_answer: "Run pod cache clean --all for CocoaPods; for Swift packages use Xcode's File → Packages → Reset Package Caches and clear DerivedData. Both re-download on next build."
tags: ["cocoapods", "swift packages", "xcode"]
related: ["https://storagestudio.us/faq/mac-storage-basics/is-it-safe-to-delete-deriveddata", "https://storagestudio.us/faq/mac-storage-basics/how-do-i-free-up-space-used-by-xcode"]
applies_to: "all"
last_reviewed: 2026-10-01
---

# How do I clear CocoaPods and Swift package caches?

Both keep a download cache you can clear safely.

- **CocoaPods**: `pod cache clean --all` empties its download cache.
- **Swift Package Manager**: Xcode keeps resolved packages per project inside DerivedData, and a shared download cache in your Library's caches; **File → Packages → Reset Package Caches** in Xcode resets a project's packages.

Both are rebuilt on the next resolve or install; expect a slower first build.
