Skip to content

Carthage keeps built frameworks in every project and a shared cache on top

Carthage builds dependencies into each project's Carthage folder and caches downloads globally. How to find old projects' builds and clear the cache.

4 min read

Carthage builds each dependency and puts the result in the project's Carthage/Build folder, with source checkouts in Carthage/Checkouts. It also keeps a global cache of downloads and builds. Old iOS projects often still carry hundreds of MB of Carthage builds.

du -sh ~/Library/Caches/org.carthage.CarthageKit 2>/dev/null
find ~ -maxdepth 5 -type d -name Carthage -prune -exec du -sh {} + 2>/dev/null | sort -h | tail

Clear it

rm -rf ~/Library/Caches/org.carthage.CarthageKit
# In a project you are not working on
rm -rf Carthage/Build Carthage/Checkouts

carthage bootstrap rebuilds them when needed. Many projects have moved to Swift Package Manager, whose caches are in Swift Package Manager cache.

Common questions

Where is the Carthage cache on a Mac?

In ~/Library/Caches/org.carthage.CarthageKit, plus a Carthage folder inside each project.

Is it safe to delete Carthage/Build?

Yes. carthage bootstrap rebuilds it.

Is Carthage still needed?

Many projects have moved to Swift Package Manager. If yours has, the Carthage folders and cache can go.

Read next