如何从项目中删除CocoaPods? [英] How to remove CocoaPods from a project?

查看:69
本文介绍了如何从项目中删除CocoaPods?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从项目中删除CocoaPods的正确方法是什么?我要删除整个CocoaPod。由于客户的某些限制,我无法使用它。我只需要一个xcodeproj而不是一个xcworkspace。

What's the right way of removing CocoaPods from a project? I want to remove the whole CocoaPod. Due to some limitations imposed by my client I can't use it. I need to have just one xcodeproj instead of an xcworkspace.

推荐答案

可以从项目中删除CocoaPods,但目前尚不能通过CLI。首先,如果您唯一的问题是无法使用 xcworkspace ,则可以仅使用 xcodeproj 使用CocoaPods使用 -no-integrate 标志将产生 Pods.xcodeproj 而不是工作区。然后,您可以将此 xcodeproj 作为子项目添加到主 xcodeproj 中。

Removing CocoaPods from a project is possible, but not currently automated by the CLI. First thing, if the only issue you have is not being able to use an xcworkspace you can use CocoaPods with just xcodeprojs by using the --no-integrate flag which will produce the Pods.xcodeproj but not a workspace. Then you can add this xcodeproj as a subproject to your main xcodeproj.

如果您确实要删除所有CocoaPods集成,则需要做一些事情:

If you really want to remove all CocoaPods integration you need to do a few things:

注意编辑其中一些内容如果做错了,可能会破坏您的主要项目。我强烈建议您将项目检查到源代码管理中,以防万一。这些说明也适用于CocoaPods版本 0.39.0 ,它们可能会随着新版本而更改。

NOTE editing some of these things if done incorrectly could break your main project. I strongly encourage you to check your projects into source control just in case. Also these instructions are for CocoaPods version 0.39.0, they could change with new versions.


  1. 删除独立文件( Podfile Podfile.lock 和您的 Pods 目录)

  2. 删除生成的 xcworkspace

  3. 打开您的 xcodeproj 文件,删除对 Pods.xcconfig libPods.a 的引用(在 Framework 组中)

  4. 在您的建造阶段下,删除复制Pod资源嵌入式Pod框架检查Pod Manifest.lock 阶段。

  5. 这似乎很明显,但您需要以其他方式集成第三方库或从代码中删除对它们的引用。

  1. Delete the standalone files (Podfile Podfile.lock and your Pods directory)
  2. Delete the generated xcworkspace
  3. Open your xcodeproj file, delete the references to Pods.xcconfig and libPods.a (in the Frameworks group)
  4. Under your Build Phases delete the Copy Pods Resources, Embed Pods Frameworks and Check Pods Manifest.lock phases.
  5. This may seem obvious but you'll need to integrate the 3rd party libraries some other way or remove references to them from your code.

在完成这些步骤之后,您应该设置一个整合了CocoaPods之前存在的 xcodeproj 。如果我错过了任何事情,请告诉我,我将对其进行编辑。

After those steps you should be set with a single xcodeproj that existed before you integrated CocoaPods. If I missed anything let me know and I will edit this.

此外,我们一直在寻找有关如何改善CocoaPods的建议,因此,如果您有任何问题,请提交给他们在我们的问题跟踪器中,这样我们就可以找到一种解决方法!

Also we're always looking for suggestions for how to improve CocoaPods so if you have an issues please submit them in our issue tracker so we can come up with a way to fix them!

编辑

,显示了一个cocoapods-from-a-project / 16427883?noredirect = 1#comment42502727_16427883> ,其中有一个第三方CocoaPods插件可以为您自动执行这些步骤。可以在此处找到。请注意,它是第三方插件,在CocoaPods升级时,可能不会总是更新。另外请注意,它是由CocoaPods核心团队成员制作的,因此不会出现问题。

As shown by Jack Wu in the comments there is a third party CocoaPods plugin that can automate these steps for you. It can be found here. Note that it is a third party plugin and might not always be updated when CocoaPods is. Also note that it is made by a CocoaPods core team member so that problem won't be a problem.

这篇关于如何从项目中删除CocoaPods?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆