从项目中删除CocoaPods的正确方法是什么?我想移除整个CocoaPod。由于客户的限制,我不能使用它。我只需要一个xcodeproj,而不是一个xcworkspace。
当前回答
使用这些终端的命令(不要忘记在新行开始使用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
其他回答
你需要做的第一件事是删除Podfile, Podfile。锁、Pods文件夹和生成的工作区。 接下来,在.xcodeproj中,删除对Pods的引用。xcconfig文件和libPods。一个文件。 在Build Phases项目选项卡中,删除Check Pods清单。锁定部分(打开),复制Pods资源部分(底部)和嵌入Pod资源(底部)。 删除Pods.framework。
您唯一要做的就是包含您以前使用过的一些库。你可以通过简单地将pods文件夹中的任何文件夹拖到你的项目中(我更喜欢将它们放在我的Supporting Files文件夹中)来做到这一点。
这对我很管用。
我要写什么iv做的很简单(删除任何CocoaPods从我的项目)..
删除任何已添加的文件夹(框架,Pods,…) 删除任何添加的文件(PROJECT.)xcworkspace PodFile PodFile锁,pod - project .debug.xcconfig, pod - project .release.xcconfig… 只需保留您原来的(PROJECT, PROJECT_Tests, PROJECT.xcodeproj) 从xcode的项目中删除框架引用
从xcode中删除框架引用:
使用项目导航器 选择项目 选择目标项目 从顶部选项中选择Build Phases 保留默认组(目标依赖项、编译源、带有库的链接二进制文件、复制Bundle资源)并删除其他组
我尝试了所有这些答案,但它仍然不会建立,最终我尝试了:
pod deintegrate
pod install
这真的有效!
就好像它需要从构建阶段删除所有的pod脚本,然后重新添加它们才能工作,至少在我的情况下是这样。
删除所有相关pod文件:
xx.xc工作区 子文件 Podfile.lock
在Project Navigator中:
点击项目名称(蓝色图标)—> Targets(*)—> Build Phases—> Remove”[CP] Check Pods清单。(点击“x”)
(*)点击项目名称,你可能必须先点击“显示项目和目标列表”才能看到侧栏。
从终端cd移动到项目文件夹。下面的步骤有助于将pod从项目中分离出来
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod clean
$ rm Podfile
然后只需打开项目文件,并删除Pod文件夹,如果它仍然在项目资源管理器的红色。构建项目……它准备好了!!
推荐文章
- Ios模拟器:如何关闭应用程序
- 准备好开发人员ID的macOS安装程序包
- 创建配置文件失败
- 在成功提交我的应用程序后,“太多符号文件”
- 复制并重命名Xcode项目和相关文件夹
- iOS -构建失败,CocoaPods无法找到头文件
- Xcode 4挂在“附加到(应用程序名称)”
- 为什么单元测试中的代码不能找到包资源?
- Xcode 10的对象库去哪了?
- Xcode 10的UI元素在哪里?
- Xcode构建失败“架构x86_64未定义的符号”
- 如何使用Xcode创建。ipa文件?
- 我可以在没有“构建和运行”的情况下启动iPhone模拟器吗?
- Cocoapods命令失败,提示“No such file or directory @ dir_initialize - /Users/<username>/”。cocoapods /回购(Errno: ENOENT):“
- Xcode 4 -在新的Macintosh安装上的配置文件上“没有找到有效的签名标识”错误