从项目中删除CocoaPods的正确方法是什么?我想移除整个CocoaPod。由于客户的限制,我不能使用它。我只需要一个xcodeproj,而不是一个xcworkspace。
当前回答
赛事deintegrate
在此cmd后,在您的项目中没有Cocoapods的痕迹。
但是你的工作区引用Pods项目仍然存在,你需要手动删除以下3个文件:
xx.xc工作区 波迪夫尔 Podfile.lock
然后您可以再次使用您的项目。
玩得开心!
测试CocoaPod版本= 1.2.0
其他回答
如果你只想删除一个pod,并保留其他你可能已经安装的pod,打开app目录中的podfile并删除你想删除的pod。然后使用终端导航到你的应用目录并输入:
pod update
这将删除您从podfile中删除的pod。你将在终端中看到它已被删除:
Analyzing dependencies
Removing FirebaseUI
Removing UICircularProgressRing
注意,这个方法也会拉出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
如何从你的项目Xcode中删除pod
打开项目目录,然后运行脚本
$ pod deintegrate
$ pod clean
$ rm Podfile
然后必须手动删除.xcworkspace扩展文件
"ProjectName.xcworkspace"
或通过脚本删除
$ rm projectname.xcworkspace
Keith的回答很好——我只是想指出,因为Cocoapods 0.36开始支持动态框架,如果你正在使用“use_frameworks!”,并且你希望移除Cocoapods,你必须这样做:
在Build Phases下删除Embed Pods Frameworks阶段。
删除所有相关pod文件:
xx.xc工作区 子文件 Podfile.lock
在Project Navigator中:
点击项目名称(蓝色图标)—> Targets(*)—> Build Phases—> Remove”[CP] Check Pods清单。(点击“x”)
(*)点击项目名称,你可能必须先点击“显示项目和目标列表”才能看到侧栏。
推荐文章
- 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安装上的配置文件上“没有找到有效的签名标识”错误