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


当前回答

从终端cd移动到项目文件夹。下面的步骤有助于将pod从项目中分离出来

$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod clean
$ rm Podfile

然后只需打开项目文件,并删除Pod文件夹,如果它仍然在项目资源管理器的红色。构建项目……它准备好了!!

其他回答

pod deintegrate和pod clean是从你的项目/回购中删除CocoaPod的两个指定命令。

下面是完整的命令集:

$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod cache clean --all
$ rm Podfile

最初的解决方案是在这里找到的:https://medium.com/@icanhazedit/remove-uninstall- deintegre-cocoapods-from-your-xcode -ios-project-c4621cee5e42#.wd00fj2e5

关于pod分解的CocoaPod文档:https://guides.cocoapods.org/terminal/commands.html#pod_deintegrate

我觉得你不需要再分解了。我可以在终端中使用以下命令做到这一点:

正在安装

它会自动删除那些不在播客文件中的

你需要做的第一件事是删除Podfile, Podfile。锁、Pods文件夹和生成的工作区。 接下来,在.xcodeproj中,删除对Pods的引用。xcconfig文件和libPods。一个文件。 在Build Phases项目选项卡中,删除Check Pods清单。锁定部分(打开),复制Pods资源部分(底部)和嵌入Pod资源(底部)。 删除Pods.framework。

您唯一要做的就是包含您以前使用过的一些库。你可以通过简单地将pods文件夹中的任何文件夹拖到你的项目中(我更喜欢将它们放在我的Supporting Files文件夹中)来做到这一点。

这对我很管用。

赛事deintegrate

在此cmd后,在您的项目中没有Cocoapods的痕迹。

但是你的工作区引用Pods项目仍然存在,你需要手动删除以下3个文件:

xx.xc工作区 波迪夫尔 Podfile.lock

然后您可以再次使用您的项目。

玩得开心!

测试CocoaPod版本= 1.2.0

使用这些终端的命令(不要忘记在新行开始使用sudo):

open:YourDir YouName$ sudo gem uninstall cocoapods
Password:?
Remove executables:
    pod, sandbox-pod

in addition to the gem? [Yn]  Y
Removing pod
Removing sandbox-pod
Successfully uninstalled cocoapods-1.4.0
open:YourDir YourName$ gem list --local | grep cocoapods
cocoapods-core (1.4.0)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.1.3)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.3.0)
cocoapods-try (1.1.0)

逐个卸载列表,如下所示:

open:YourDir YourName$ sudo gem uninstall cocoapods-core
Successfully uninstalled cocoapods-core-1.4.0
open:YourDir YourName$ sudo gem uninstall cocoapods-trunk
Successfully uninstalled cocoapods-trunk-1.3.0
open:YourDir YourName$ sudo gem uninstall cocoapods-try
Successfully uninstalled cocoapods-try-1.1.0
open:YourDir YourName$ gem list --local | grep cocoapods
open:YourDir YourName$ sudo gem uninstall cocoapods-stats
Successfully uninstalled cocoapods-stats-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-search
Successfully uninstalled cocoapods-search-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-downloader
Successfully uninstalled cocoapods-downloader-1.1.3
open:YourDir YourName$ sudo gem uninstall cocoapods-plugins
Successfully uninstalled cocoapods-plugins-1.0.0
open:YourDir YourName$ gem list --local | grep cocoapods
cocoapods-deintegrate (1.0.2)
open:YourDir YourName$ sudo gem uninstall cocoapods-deintegrate
Successfully uninstalled cocoapods-deintegrate-1.0.2
open:YourDir YourName$ sudo gem uninstall cocoapods-stats
Successfully uninstalled cocoapods-stats-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-search
Successfully uninstalled cocoapods-search-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-downloader
Successfully uninstalled cocoapods-downloader-1.1.3
open:YourDir YourName$ sudo gem uninstall cocoapods-plugins
Successfully uninstalled cocoapods-plugins-1.0.0
open:YourDir YourName$ gem list --local | grep cocoapods
cocoapods-deintegrate (1.0.2)
open:YourDir YourName$ sudo gem uninstall cocoapods-deintegrate
Successfully uninstalled cocoapods-deintegrate-1.0.2