Guides
How to cache Xcode DerivedData
Xcode rebuilds the whole project on every CI run.
5 min read
Xcode rebuilds the whole project on every CI run.
Why it happens
DerivedData holds the incremental build state and is discarded between jobs.
How to fix it
- Cache ~/Library/Developer/Xcode/DerivedData keyed on the Xcode version and lockfiles
- Pass -derivedDataPath explicitly so the location is predictable
- Invalidate on Xcode version — DerivedData from another toolchain causes strange failures
Your next build could be twice as fast, at half the price
Start free. Migrating away is the same one line, and we publish that diff too.
Related
How to make CI caches actually persistCaches are configured but hit rate is low.How to work around the 10 GB cache limitYour caches exceed 10 GB per repository and start silently evicting.How to share a build cache across repositoriesEach repository maintains its own cache for the same shared dependencies.How to share a Docker cache between jobsEach matrix leg rebuilds the same layers.