CocoaPods - use a specific version of pod

I am using CocoaPods for a MacOS application. I have compilation errors with AFNetworking (current version, 1.2.1) and I saw that they were not in the previous version (1.2.0).

I did some research, but did not find a way to determine the version of the module (for example, version 1.2.0 instead of 1.2.1).

Is this possible, or should I wait until a new version of this library appears?

+80
objective-c xcode cocoapods afnetworking macos
May 26 '13 at 10:21
source share
4 answers

In your file:

pod 'AFNetworking', '1.2.0' 

Check out "Get Started" at http://cocoapods.org

Once this is done, you can pod update in the terminal for the changes to take effect. Of course, you need to do this from the top-level folder of your project. If the update does not occur, edit the Podfile.lock file and change the version number of AFNetworking to something less than it is, and run pod update in the terminal again. This tells CocoaPods that you have a different version installed and that it should be updated.

+180
May 26 '13 at 10:25
source share
— -
  1. In your subfile write: pod 'podname', 'required version'.
  2. Close project

  3. Run pod update or pod install (as the case may be) to get the modules as indicated in the previous step.

  4. Compile the code with the correct version of the module.

+3
Jan 21 '19 at 18:41
source share

Use platform: ios, '8.0'. It will automatically install the previous one, which will be launched on this platform.

+1
Mar 22 '16 at 9:46
source share

Here are all possible ways to install pod with use cases.

  1. To install the latest module , skip the version number after the module name.

    pod 'Alamofire'

  2. To install a specific module version, enter the module name after the module name.

    pod 'Alamofire', '5.0.0'

    In addition to any version or specific, you can also use logical operators:

    • '> 0.1' Any version above 0.1
    • '> = 0.1' Version 0.1 and any later version
    • "<0.1" Any version below 0.1
    • "<= 0.1" Version 0.1 and any lower version
  3. To install the latest pod subversion of the specified pod version:

    pod 'Alamofire', '~> 0.1.2'

    • '~> 0.1.2' Version 0.1.2 and versions up to 0.2, not including 0.2 and higher
    • '~> 0.1' Version 0.1 and versions up to 1.0, not including 1.0 and higher
    • '~> 0' Version 0 and higher is almost the same as not having it.
  4. To use pod from the folder path on the local computer :

    pod 'Alamofire', :path => '~/Documents/Alamofire'

  5. Install modules from a remote master branch

    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git'

  6. Install modules from a remote branch

    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'dev'

  7. Install modules from a specific tag in a remote branch

    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => '3.1.1'

  8. Install modules from a specific commit in a remote branch

    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :commit => '0f506b1c45'

    For more details, check out the link: Cocoa Pod Installation Guide

0
Jun 12 '19 at 11:08
source share



All Articles