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...)

Diagnose it: SDK, signing, or simulator?

Mobile CI failures cluster into three: a missing or mismatched SDK component, a code-signing identity that does not exist on the runner, or a simulator or emulator that never became ready.

Terminal
# Android
sdkmanager --list_installed 2>/dev/null | head
echo "ANDROID_HOME=$ANDROID_HOME"
adb devices

# iOS
xcodebuild -version && xcrun simctl list devices available | head
security find-identity -v -p codesigning

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.

Frequently asked questions

What causes CocoaPods "pod repo update" slow / hanging in CI?
There are 2 common causes: cloning the legacy git specs repo and no cache for the cocoapods state. The old master spec repo is gigabytes of git history.
How do I fix CocoaPods "pod repo update" slow / hanging in CI?
There are 2 fixes depending on which cause you have: use the cdn source instead of the git repo and cache cocoapods state between runs. Work through them in order, since the first is the most common.
What does CocoaPods "pod repo update" slow / hanging in CI actually mean?
pod install/pod repo update stalls for minutes on "Updating spec repo master" or "Setting up CocoaPods master repo".
How do I stop CocoaPods "pod repo update" slow / hanging in CI happening again?
Use the cdn.cocoapods.org source, not the git master repo. The prevention section lists 3 changes that keep it from recurring.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

This is a transient network failure, not a bug in your code. Latchkey detects, repairs, and retries it for you. Start free → 30-day trial · No credit card