How to install specific pod without touching other dependencies

♀尐吖头ヾ 提交于 2019-12-03 04:48:24

问题


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.


回答1:


To Skip running pod repo update before install.Use

pod install --no-repo-update



回答2:


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!




回答3:


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'




回答4:


Here you can skip integration of the Pods libraries in the Xcode project(s) by using following command.

pod install --no-integrate

Pod install

Hope this help you.




回答5:


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.




回答6:


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' 



回答7:


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




回答8:


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)




回答9:


pod repo update && pod update 'YOURPOD'


来源:https://stackoverflow.com/questions/30372294/how-to-install-specific-pod-without-touching-other-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!