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.
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
source 'https://cdn.cocoapods.org/'
# Then install without touching the legacy master repo:
pod installCache CocoaPods state between runs
Cache ~/.cocoapods so the index is reused instead of re-fetched.
- uses: actions/cache@v4
with:
path: ~/.cocoapods
key: pods-${{ hashFiles('Podfile.lock') }}How to prevent it
- Use the
cdn.cocoapods.orgsource, not the git master repo. - Cache
~/.cocoapodskeyed onPodfile.lock. - Avoid
pod repo updateunless you actually need a fresh index.