org.swift.swiftpm is the global cache where Swift Package Manager keeps cloned package repositories and manifests, shared by all your projects. It is safe to clear. Run swift package purge-cache or delete the folder with Xcode closed, and packages re-download the next time a project resolves.
- Path
~/Library/Caches/org.swift.swiftpm- What it is
- Shared cache of Swift package repositories and manifests
- Typical size
- Hundreds of megabytes to a few gigabytes, depending on how many packages you use
- Made by
- Swift Package Manager (Xcode and the swift command)
- Safe to delete?
- Safe to clear
- Comes back?
- Yes, packages download again the next time a project resolves its dependencies
What is in this folder?
Both Xcode and the swift command line use this cache so a package used by several projects is only fetched once. It holds bare clones of package repositories, plus cached manifest results.
Each project also has its own checkouts, in the project or inside DerivedData, so this cache only saves download time. It is not the source of truth for your dependency versions; Package.resolved in your project is.
Is it safe to delete?
Yes. Clearing it costs a re-download and a slower first resolve for each project. It does not change which versions your projects use.
If you work offline, keep it, because a cleared cache cannot be refilled without network access. Package resolve errors such as a stale checkout are also a reason people clear it.
How do I clear it by hand?
- Quit Xcode.
- Run the SwiftPM command below. It removes the shared cache.
- Open your project. Xcode fetches the packages again.
swift package purge-cacheIf the command is not available on an older toolchain, delete the folder instead: rm -rf ~/Library/Caches/org.swift.swiftpm with Xcode closed. In Xcode, File, Packages, Reset Package Caches does a similar job for the open project.
How do I stop it growing?
It refills as you add packages. Clear it occasionally, or after removing projects you no longer build.
How Clean House handles it
Clean House recognizes Swift package caches as downloaded Swift packages made by Swift Package Manager, treats them as data that comes back, and explains that in the Why card. Cleared files go to the Trash, so you can put them back from Recently Cleared.