Accidentally ran pod update instead of pod install. Is there any way to revert?

流过昼夜 提交于 2019-12-05 05:19:17

If you use git or other version control system, just reset changes in Podfile.lock and run $ pod install in terminal.

You can go through the version changes in the pod install's output and rewrite your podfile with the desired versions.


For example:

In pod install output below, SwiftSpinner was updated from 0.9.5 to 1.0.2

Therefore, in the podfile change the line

pod 'SwiftSpinner'

to

pod 'SwiftSpinner', '0.9.5'

and run pod update again.


Now, you might get errors reverting certain pods:

[!] Unable to satisfy the following requirements:

- `Realm (= 1.0.2)` required by `Podfile`

- `Realm (= 1.1.0)` required by `Podfile.lock`

In such a case, close Xcode, delete your podfile and run pod install again.

Deepjyot Kaur

The best way is to remove the pods directory from your project and update and install it again.

rm -rf Pods 
bundle exec pod repo update
bundle exec pod install

Remove the following files and folders:
- xcworkspace
- Podfile.lock
- Pods (Folder)

After, run:

$ pod install

This seems like something risky, but really it is not. I do it all the time

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