pod install: CocoaPods Dependencies in CI
pod install installs the exact pods pinned in Podfile.lock and generates the .xcworkspace; pod update is what changes versions.
CocoaPods trips CI in two classic ways: a stale spec repo and a Podfile.lock that does not match the Podfile. Knowing that install respects the lockfile while update rewrites it saves most of the debugging.
What it does
pod install reads the Podfile and Podfile.lock, downloads the locked pod versions, and integrates them into an Xcode workspace. pod update ignores the lock and resolves to the newest allowed versions. pod repo update refreshes the local copy of the spec repositories.
Common usage
pod install
pod install --repo-update # refresh specs, then install
pod install --deployment # CI: fail if the lockfile would change
pod _1.15.2_ install # pin the CocoaPods version via the gem
pod cache clean --allOptions
| Flag / command | What it does |
|---|---|
| --repo-update | Update the spec repos before installing |
| --deployment | Error if install would modify the Podfile.lock (CI-safe) |
| --clean-install | Force re-download even if cached |
| pod repo update | Refresh the spec repositories |
| pod cache clean --all | Clear the CocoaPods download cache |
| pod _<version>_ install | Run a specific installed CocoaPods gem version |
In CI
Use pod install --deployment so the build fails loudly if Podfile.lock is out of date instead of silently mutating it. Cache ~/Library/Caches/CocoaPods and the Pods/ directory keyed on Podfile.lock to cut minutes off each run. Pin the CocoaPods gem version to match what generated the lockfile.
Common errors in CI
"The sandbox is not in sync with the Podfile.lock. Run pod install" means the lockfile and installed Pods disagree; run pod install (and commit the result) or use --deployment to catch it early. "Unable to find a specification for ..." means a stale spec repo; add --repo-update. "CDN: trunk Repo update failed" is a transient CocoaPods CDN issue; retry or run pod repo update. A Ruby version mismatch surfaces as a bundler/gem error before pod even runs.