从项目中删除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
其他回答
从终端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
开发者可能面临两个方面的问题。
要么他想把舱完全从项目中移除 开发人员想从项目中卸载特定的框架 豆荚。
在第一种情况下,你必须使用“豆荚分解”,并遵循以上答案中提到的几个步骤。
第二种情况是,如果你想卸载安装在pod文件中的任何特定框架,很简单的方法就是注释你想卸载的框架,然后运行pod install命令。
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ProjectName' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'iCarousel', '~> 1.8'
# pod 'Facebook-iOS-SDK', '~> 4.1'
# pod 'ParseFacebookUtilsV4', '~> 1.11'
# pod 'Parse', '~> 1.14'
end
在这里,我想卸载facebook和解析框架(使用pods安装),而不是iCarousel,这就是为什么我像上面那样更新了我的pod文件。
现在如果我运行pod安装,它将保持iCarousel,因为它是在我的项目,并将删除facebook和解析。
我觉得你不需要再分解了。我可以在终端中使用以下命令做到这一点:
正在安装
它会自动删除那些不在播客文件中的
如果你只想删除一个pod,并保留其他你可能已经安装的pod,打开app目录中的podfile并删除你想删除的pod。然后使用终端导航到你的应用目录并输入:
pod update
这将删除您从podfile中删除的pod。你将在终端中看到它已被删除:
Analyzing dependencies
Removing FirebaseUI
Removing UICircularProgressRing
注意,这个方法也会拉出podfile中其他pod的任何更新。你可能想要也可能不想要。
推荐文章
- 你常用的Xcode快捷键有哪些?
- 确保您的项目构建设置正在生成一个dSYM文件。对于所有配置,DEBUG_INFORMATION_FORMAT都应该设置为dwarf-with-dsym
- 如何改变时间和时区在iPhone模拟器?
- 为iOS模拟器构建,但链接框架'****.framework'是为iOS构建的
- 如何象征崩溃日志Xcode?
- Xcode - ld:没有为- lpods找到库
- 我如何输入RGB值到接口生成器?
- 在Xcode单元测试中使用@可测试时“没有这样的模块”
- 将故事板从iPhone转换为iPad
- 如何检查文档文件夹中是否存在文件?
- keychain上的分发证书中缺少私钥
- Xcode的构建文件夹在哪里?
- Xcode 4在目标设备上说“finished running <my app>”——什么都没有发生
- 图书馆吗?静态的?动态吗?或框架?另一个项目中的项目
- Xcode 6 gitignore文件应该包括什么?