Skip to content
Latchkey

CocoaPods "pod repo update" Slow / Hanging in CI

CocoaPods is cloning or updating the full git "master" Specs repository, which is enormous. On CI that clone can take many minutes or appear to hang, even though the build itself is fine.

What this error means

pod install/pod repo update stalls for minutes on "Updating spec repo master" or "Setting up CocoaPods master repo". The job is not failing - it is downloading the entire legacy spec git history.

pod output
Updating spec repo `master`
  $ /usr/bin/git -C ... fetch origin
  (no output for several minutes...)

Common causes

Cloning the legacy git Specs repo

The old master spec repo is gigabytes of git history. Cloning or fetching it on every CI run is slow and can look like a hang.

No cache for the CocoaPods state

Without caching ~/.cocoapods, every run re-fetches the index from scratch, multiplying the cost.

How to fix it

Use the CDN source instead of the git repo

The CDN serves only the specs you need, avoiding the giant git clone.

Podfile
# Podfile
source 'https://cdn.cocoapods.org/'

# Then install without touching the legacy master repo:
pod install

Cache CocoaPods state between runs

Cache ~/.cocoapods so the index is reused instead of re-fetched.

.github/workflows/ci.yml
- uses: actions/cache@v4
  with:
    path: ~/.cocoapods
    key: pods-${{ hashFiles('Podfile.lock') }}

How to prevent it

  • Use the cdn.cocoapods.org source, not the git master repo.
  • Cache ~/.cocoapods keyed on Podfile.lock.
  • Avoid pod repo update unless you actually need a fresh index.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →