pod install --verbose to see progress, or pre-clone a shallow copy with git clone --depth 1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master before running pod install.Why this happens
When you run pod install for the first time on a machine, CocoaPods needs a local copy of the Specs repository — the index of all available pods. By default it clones the full Git history from https://github.com/CocoaPods/Specs.git into ~/.cocoapods/repos/master. That repository has grown to well over 1 GB, so on a typical connection the clone can take many minutes with zero visible output, making it look like the command has frozen.
The silent period is purely network and disk I/O; CocoaPods does not print progress until the clone finishes. If you interrupt it (Ctrl-C) and run pod install again, it will simply restart the clone from the beginning.
Modern CocoaPods versions (1.10+) can also use a CDN instead of the Git repo, but the legacy master repo is still the default for many existing projects unless you explicitly opt in to the CDN in your Podfile.
How to fix it
1. Watch the actual progress with verbose output
Run the command in verbose mode so you can see the Git clone happening:
pod install --verbose
You will see lines like:
Setting up CocoaPods master repo
Cloning spec repo `master` from `https://github.com/CocoaPods/Specs.git` (branch `master`)
$ /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master
Cloning into 'master'...
This confirms the process is alive. Wait it out — on a decent broadband connection it typically finishes in 2–10 minutes.
2. Pre-clone a shallow copy (much faster)
You only need the latest commit of the Specs repo, not the entire history. Clone it once with --depth 1 before running pod install:
# Cancel any running pod install first (Ctrl-C)
cd ~/.cocoapods/repos
# Remove a partial clone if one exists
rm -rf master
# Shallow clone — ~500 MB instead of 1+ GB
git clone --depth 1 https://github.com/CocoaPods/Specs.git master
Now run pod install normally. CocoaPods will detect the existing master directory and skip the clone step entirely.
3. Switch to the CDN source (recommended for new projects)
Add the CDN line at the top of your Podfile before any source lines:
source 'https://cdn.cocoapods.org/'
# Your platform and target definitions follow
platform :ios, '15.0'
target 'MyApp' do
pod 'Alamofire'
end
The CDN serves a lightweight JSON index instead of the massive Git repo, so the first pod install becomes nearly instantaneous. Existing projects can keep the old source 'https://github.com/CocoaPods/Specs.git' line alongside the CDN line; CocoaPods will prefer the CDN.
4. Use a local mirror or SSH if GitHub is slow
If your network throttles GitHub, point the clone to a closer mirror or use SSH (requires a GitHub account with SSH keys):
git clone --depth 1 git@github.com:CocoaPods/Specs.git ~/.cocoapods/repos/master
Then run pod install as usual.
How to prevent it
- Add
source 'https://cdn.cocoapods.org/'to every newPodfileto avoid the Git clone entirely. - Commit the
Pods/directory (or at leastPodfile.lock) to your repo so CI/CD runners can runpod install --repo-updatewithout a full clone. - On shared machines, pre-populate
~/.cocoapods/repos/masterwith a shallow clone during machine provisioning. - Keep CocoaPods updated (
gem install cocoapods) — newer versions handle the CDN fallback more gracefully.
FAQ
Does deleting ~/.cocoapods/repos/master break anything?
No. It only removes the local Specs index. The next pod install will re-download it (or use the CDN if configured). Your installed pods in Pods/ are untouched.
Why does pod repo update also hang?
pod repo update fetches the latest commits for every spec repo you have configured. If you still use the legacy master repo, it pulls the full Git history again. Switch to the CDN source to make updates instant.
Can I use CocoaPods without any Specs repo at all?
Not completely — CocoaPods needs a source to resolve pod names to versions and download URLs. The CDN source is the lightest option; it downloads a small JSON file instead of cloning a Git repository.
If you still see the hang after trying the shallow clone, check your network for GitHub rate limits or proxy settings that might throttle large transfers.
Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.
