I want to install specific dependency using cocoapods
. if I execute pod install
, other dependencies are getting updated before installing my newly added dependency. I just want to install specific pod without touching any others. And I know deleting
, updating
any dependency also updates others. Is there any way to solve this problem?
Actually my problem is when I myself modify some dependency (AFNetworking for example) and run pod install
it reverts back to its original version. But I don't want to lose my changes.
To Skip running pod repo update before install.Use
pod install --no-repo-update
To install a plugin without updating existing ones-> Add that plugin in your Podfile and use:
pod install --no-repo-update
To remove/update a specific plugin use:
pod update POD_NAME
Tested!
1) If you want to update single pod
pod update 'yourpodname'
2) if you want to install one pod without affecting another pod
pod install --no-repo-update
3)if you want to install/update specific version of pod
pod 'Stripe', '3.0'
4) if you want to install/update latest version of pod than
pod 'KCFloatingActionButton', '~> 2.1.0'
Here you can skip integration of the Pods libraries in the Xcode project(s) by using following command.
pod install --no-integrate
Hope this help you.
At the time of writing, pod install will only install pods in the PodFile that haven't already been installed. The others will not be updated. This issue appears to have been solved by the CocoaPods project.
Here is another way of doing it. If you want to install newly added pod and don't want to update other dependancies you need to remove "~>" from all your pods you don't want to update. For example in case of AFNetworking
pod 'AFNetworking', '2.2.1' instead of pod 'AFNetworking',~> '2.2.1'
If you have your first "Podfile.lock" in your project folder, you just have to use
pod install
Your "Podfile.lock" has registered the version of your old pod so you don't need to do something else
Do not get confused just open up the existing file and added the numbers of pod file below the existing pods.
Further, go to terminal and open up your project and run command:
$ pod install
(This command will only add on the new pod without disturbing your existing pods)
pod repo update && pod update 'YOURPOD'
来源:https://stackoverflow.com/questions/30372294/how-to-install-specific-pod-without-touching-other-dependencies