What exactly does `pod repo update` do?

A Tyshka picture A Tyshka · Apr 30, 2017 · Viewed 49.3k times · Source

I'm following an internet tutorial on Firebase and as part of it, I had to do some work on the command line. I'm pretty comfortable with the command line, but I'm unfamiliar with Cocoapods. I ran pod repo update but after doing so I realized I ran it on my entire Documents folder of my Mac instead of the folder that contained my project. I took over 20 mins to execute and it printed out literally thousands of things when it finally completed, some of which included "create" and "deleted". I was kind of concerned- would run this command have modified anything in my Documents besides the Firebase project? And what does pod repo update even do for that matter?

Answer

Scriptable picture Scriptable · Jul 13, 2017

As per the documentation pod repo update updates the spec repos located at ~/.cocoapods/repos in your home folder.

Updates the local clone of the spec-repo NAME. If NAME is omitted this will update all spec-repos in ~/.cocoapods/repos.

The repo is basically a list of all pods and versions available. I have just encountered an error in our CI builds because the repo did not include a spec for a library I have just added. By running pod repo update it now knows of this newer version and can continue to install it.

So to answer your question.. Running pod repo update in your documents folder will not do anything in that folder. It will update its pod spec references in your ~/.cocoapods/repos folder only.