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


当前回答

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

正在安装

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

其他回答

赛事deintegrate

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

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

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

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

玩得开心!

测试CocoaPod版本= 1.2.0

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

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

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

使用这些终端的命令(不要忘记在新行开始使用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

要从项目中完全删除pod,你需要先安装两件事…这些是以下(假设你已经在你的系统中安装了可可荚)…

Cocoapods-Deintegrate插件 Cocoapods-Clean插件

安装

Cocoapods-Deintegrate插件 在您的终端上使用以下命令来安装它。 Sudo gem安装cocoapods-deintegrate Cocoapods-Clean插件 在您的终端上使用以下命令来安装它。 须藤宝石安装椰荚干净

使用

首先进入你的项目文件夹,使用as usual命令,如..

cd (path of the project) //Remove the braces after cd

现在使用这两个插件完全删除它如下..

Cocoapods-Deintegrate插件 在您的终端上使用以下命令首先从项目中分解pod。 豆荚去积分

Cocoapods-Clean插件 从项目中分解pod后,在终端上使用以下命令彻底清理它。 舱清洁 在完成上述任务后,您的项目目录中应该还保留着Podfile .只需手动删除它或在终端上使用以下命令。 rm Podfile

这是……现在你有你的项目从豆荚自由…清洁。

将Cocoapods从系统中移除。

以任何方式尝试在您的终端上使用以下命令从您的系统中卸载/删除可口可乐。

sudo gem uninstall cocoapods

它会自动去除可乐皮。

谢谢。 希望这对你有所帮助。

Keith的回答很好——我只是想指出,因为Cocoapods 0.36开始支持动态框架,如果你正在使用“use_frameworks!”,并且你希望移除Cocoapods,你必须这样做:

在Build Phases下删除Embed Pods Frameworks阶段。