281

I have updated Flurry via CocoaPods, but how can I check if Flurry was updated?

I mean the terminal shown me that everything is ok:

Installing FlurrySDK (4.2.3)
Generating Pods project
Integrating client project

but I am not sure that it has been updated.

Hasen
  • 11,710
  • 23
  • 77
  • 135
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
  • 34
    Just in case readers come here looking for how to check their version of CocoaPods, the answer to that is type pod --version in bash – Bradley Thomas Mar 08 '14 at 04:45
  • 8
    ```$ cat Podfile.lock``` command to trace package version – pqteru Oct 14 '16 at 03:18
  • 2
    You can add grep command to the above comment, to filter a specific pod. In your case with Flurry: `$ cat Podfile.lock | grep FlurrySDK` – Bocaxica Nov 26 '21 at 09:50

14 Answers14

321

The Podfile.lock keeps track of the resolved versions of each Pod installed. If you want to double check that FlurrySDK is using 4.2.3, check that file.

Note: You should not edit this file. It is auto-generated when you run pod install or pod update

MishieMoo
  • 6,620
  • 2
  • 25
  • 35
213

To check version of cocoapods from terminal:

For Sudoless:

gem which cocoapods

For Sudo:

sudo gem which cocoapods

Also note: If you want to edit podfile or podfile.lock don't edit it in editors. Open only with XCode.

Nagarjun
  • 6,557
  • 5
  • 33
  • 51
  • 1
    thanks, works for me! but just in case checking cocoa pods version. Not just some library version, like in my question which was answered, but maybe your answer will help someone. – Matrosov Oleksandr Jul 03 '15 at 09:38
  • What happens if we edit those files in editor other than XCode? – ZenVentzi Oct 25 '19 at 13:16
  • We can open it but if we try to save, it will generate ASCII values and give errors. https://champlintechnologiesllc.com/20_cocoapods_xcode/ – Nagarjun Nov 27 '19 at 00:29
177

pod --version

to get the version of installed pod

Muhammad Aamir Ali
  • 20,419
  • 10
  • 66
  • 57
  • 54
    Gives the version of cocoapod only, not for the pods installed – Amit Mar 25 '16 at 13:22
  • 3
    This is incorrect. This command will give the version of `cocoapods` dependency manager, not the versions of individual pods installed. Instead, take a look at `Podfile.lock` to see the installed versions. – JaredH Mar 15 '17 at 21:22
165
pod outdated

When you run pod outdated, CocoaPods will list all pods that have newer versions that the ones listed in the Podfile.lock (the versions currently installed for each pod) and that could be updated (as long as it matches the restrictions like pod 'MyPod', '~>x.y' set in your Podfile)

fede1608
  • 2,808
  • 1
  • 16
  • 17
40

CocoaPods version

[iOS Dependency manager]

CocoaPods program version

CocoaPods program that is built with Ruby and it will be installable with the default Ruby available on macOS.

pod --version //1.8.0.beta.2
//or
gem which cocoapods //Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.0.beta.2/lib/cocoapods.rb

//install or update
sudo gem install cocoapods

A pod version

Version of pods that is specified in Podfile

Podfile.lock

It is located in the same folder as Podfile. Here you can find a version of a pod which is used

Search for pods

If you are interested in all available version of specific pod you can use

pod search <pod_name>
//or
pod trunk info <pod_name>

Set a pod version in Podfile

//specific version
pod '<framework_name>', "<semantic_versioning>"
// for example
pod 'MyFramework', "1.0"
yoAlex5
  • 29,217
  • 8
  • 193
  • 205
23

If you have Installed Cocoapods using Homebrew then only use This Command:

pod --version

and it should show in this format:

1.11.0
Nachiket Gohil
  • 955
  • 11
  • 17
18

You can figure out version of Cocoapods by using below command :

pod —-version

o/p : 1.2.1

Now if you want detailed version of Gems and Cocoapods then use below command :

gem which cocoapods (without sudo)

o/p : /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods.rb

sudo gem which cocoapods (with sudo)

o/p : /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods.rb

Screenshot 1

Now if you want to get specific version of Pod present in Podfile then simply use command pod install in terminal. This will show list of pod being used in project along with version.

Screenshot 2

Mazen Kasser
  • 3,559
  • 2
  • 25
  • 35
Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
6

I wrote a small commandline tool that parses the Podfile.lock and shows which version of each Pod is currently installed. It will also check for the latest version online and give you a summary of dependencies which are out-of-date.

You can find it on Github: https://github.com/citruz/podchecker

Felix Seele
  • 857
  • 9
  • 8
  • Dependencies with unknown state: Getting above message for the latest framework updated. just like ----------------------------------------- Dependencies with unknown state: Facebook: 4.1.0 (Couldn't determine installed version) GoogleAnalytics: 3.13.0 (Couldn't determine installed version) – Mehul Chuahan Sep 14 '15 at 10:00
  • Doesn't work for me. I'm always getting "The contents of this script should nerev run! ...". Any ideas, toffifee? I do have perl installed. – Fengson Mar 10 '16 at 07:36
  • Sorry I cannot reproduce your error. Do you have node.js/npm installed and did you run `npm install -g podchecker` to install the tool? – Felix Seele Mar 11 '16 at 09:56
4

The highest voted answer (MishieMoo) is correct but it doesn't explain how to open Podfile.lock. Everytime I tried I kept getting:

enter image description here

You open it in terminal by going to the folder it's in and running:

vim Podfile.lock

I got the answer from here: how to open Podfile.lock

You close it by pressing the colon and typing quit or by pressing the colon and the letter q then enter

:quit // then return key
:q // then return key

Another way is in terminal, you can also cd to the folder that your Xcode project is in and enter

$ open Podfile.lock -a Xcode

Doing it the second way, after it opens just press the red X button in the upper left hand corner to close.

Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
  • An easier and safer approach, as you don't touch the actual file: * duplicate podfile.lock in finder. * select dup'd file * right click, select Open With... TextEdit – drew.. Nov 25 '17 at 12:53
  • 2
    `open Podfile.lock -a TextEdit`. – Sulthan Jul 14 '18 at 16:12
  • 1
    Just open it in any text editor. Drag the file onto any text editor that exists and its contents will open up and be easily understandable. – Alex Zavatone Mar 06 '19 at 00:37
1

Podfile.lock file right under Podfile within your project.

The main thing is , Force it to open through your favourite TextEditor, like Sublime or TextEdit [Open With -> Select Sublime] as it doesn't give an option straight away to open.

Naishta
  • 11,885
  • 4
  • 72
  • 54
1

To check the installed versions of your project's pods you can use the command pod outdated and as mentioned from CocoaPods Guides

The output of each line will show you everything that you need such as: - <pod name> <current version> -> <latest version (with restrictions)> (latest version <latest version (without restrictions)>)

So current version is the installed one, the next one is the latest with the restrictions in your Podfile and the last one the available version without the restrictions.

gafos
  • 197
  • 2
  • 9
1

There are two way to know Pod version:

pod --version

1.10.1

gem which cocoapods

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods.rb

0

pod --version used this to check the version of the last installed pod

0

You can check all installed pod version by this command in terminal

gem list -- local | grep cocoapods

IKKA
  • 6,297
  • 7
  • 50
  • 88