Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
Copy link

andrewjburnett commented Jan 28, 2016

Beautiful! This saved me some headache after moving an project between users on my mac.

Copy link

nonotest commented Jan 29, 2016


Copy link

ipedro commented Mar 13, 2016


Copy link

ngheungyu commented Jun 26, 2016

Cleaning the cache doesn't mean Xocde will read the new code! One extra tips is to delete the Derived Data to prevent compiler reading the old code. Hope it helps

Copy link

justinswart commented Jun 30, 2016

rm -rf ~/Library/Caches/CocoaPods; rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*; pod deintegrate; pod setup; pod install;

Copy link

uzuume commented Jul 22, 2016


Copy link

orenk86 commented Aug 28, 2016

Clean, simple, perfect. Thanks!

Copy link

andj207 commented Nov 10, 2016

It works. Thanks.

Copy link

jeantimex commented Dec 8, 2016

Thanks mate, I hate caches!

Copy link

syzer commented Aug 15, 2017


Copy link

cprovatas commented Sep 13, 2017


Copy link

ashokds commented Sep 26, 2017

👍 Thanks!

pod cache clear --all
pod cache clear 'alamofire'
pod cache clear 'alamofire' --all // delete all installed 'alamofire' pods

Copy link

efremidze commented Oct 2, 2017

Use clean instead of clear.

pod cache clean --all
pod cache clean 'alamofire'
pod cache clean 'alamofire' --all

Copy link

olgusirman commented Nov 15, 2017

Thanks, I use it all the time!

Copy link

Urvish-modi commented Jan 31, 2018

Unable to understand what happens, i command pod install with repo update and this happens.
Anyone has idea ?

screen shot 2018-01-31 at 11 05 09 am

screen shot 2018-01-31 at 11 06 04 am

Copy link

RishabhTayal commented Apr 27, 2018

This is AWESOME! 👍

Copy link

kr-mohak commented Apr 17, 2019


Copy link

FDiskas commented Oct 8, 2019

rm -rf ~/Library/Caches/CocoaPods Pods ~/Library/Developer/Xcode/DerivedData/*; pod deintegrate; pod setup; pod install;

Copy link

chronikum commented Jan 19, 2020

thank you. Thank you so much.

Copy link

msvargas commented Apr 23, 2020


Copy link

EmmanuelC19 commented May 20, 2020

thanks ! works perfect !!

Copy link

erdemildiz commented Oct 16, 2020

rm -rf ~/Library/Caches/CocoaPods Pods ~/Library/Developer/Xcode/DerivedData && pod deintegrate && pod install

Copy link

pro100svitlo commented Dec 29, 2020


Copy link

thamtumeoden13 commented Jul 15, 2021

thank you, it's save my life

Copy link

lornebb commented Oct 28, 2021

Still working in Oct. 2021. Thanks!

Copy link

DavidAPears commented Dec 6, 2021

Still working in Dec '21. Thanks

Copy link

coderjonny commented Apr 8, 2022

Still working in Apr 2022.. thanks!

Copy link

mikeest1972 commented Apr 8, 2022

For M1 mac pod update should change to arch -x86_64 pod update. Here is a version of script for M1 mac users link

Copy link

jamescavallo commented Oct 29, 2022


Copy link

taosif7-dreamorbit commented Nov 12, 2022

Still working in Nov 2022. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment