Skip to content

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

  1. Cache ~/Library/Developer/Xcode/DerivedData keyed on the Xcode version and lockfiles
  2. Pass -derivedDataPath explicitly so the location is predictable
  3. 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.