最新消息:20210917 已从crifan.com换到crifan.org

[记录]将一个库Charts从Cocoapods中移除掉

Cocoapods crifan 1936浏览 0评论

之前折腾过了:

[记录]用Carthage添加第三方库

嫌弃没有源码不方便调试

但是现在发现:

虽然cocoapods有源码,但是每次Voce-》Product-》Clean后再重新编译时都会导致Cocoapods中的库重新编译:

-》很耗时

而此处又已经不用再去调试这个Charts库了

-》所以即使没了源码,也能接受了

-》感觉像是:

先使用Cocoapods,去带源码的方式去安装,使用,调试这个Charts库

-》用完,调试完后,再去用不带源码的Carthage去安装这个Charts库

-》这样每次clean后重新编译,就不用重新编译整个库,这么浪费时间了

所以现在要去:

把Charts库从cocoapods中移除掉

(然后顺带把之前Carthage中的Charts加上)

目前Podfile是:

# Uncomment this line to define a global platform for your project

platform :ios, ‘8.0’

# Uncomment this line if you’re using Swift

use_frameworks!

target ‘QorosSales’ do

  pod ‘Charts’, ‘~> 2.2.4’

end

target ‘QorosSalesTests’ do

end

target ‘QorosSalesUITests’ do

end

改为:

# Uncomment this line to define a global platform for your project

platform :ios, ‘8.0’

# Uncomment this line if you’re using Swift

use_frameworks!

target ‘QorosSales’ do

end

target ‘QorosSalesTests’ do

end

target ‘QorosSalesUITests’ do

end

参考:

[记录]使用Cocoapods管理iOS项目的第三方库

好像直接去

pod install

即可更新去除库了?

cocoapods remove library

使用CocoaPods(二)删除已经配置的类库和移除CocoaPods – Jymn_Chen – 博客频道 – CSDN.NET

ios – Remove or uninstall library previously added : cocoapods – Stack Overflow

xcode – How to remove CocoaPods from a project? – Stack Overflow

->以后用得着的话,再去参考帖子去删除项目中整个的cocoapods

licrifandeMacBook-Pro:QorosSales crifan$ ls -la

total 57424

drwxr-xr-x  17 crifan  staff       578  5 14 23:14 .

drwxr-xr-x   4 crifan  staff       136  5 14 11:39 ..

-rw-r–r–@  1 crifan  staff      8196  5 16 10:37 .DS_Store

-rw-r–r–   1 crifan  staff        18  5 14 16:28 .gitignore

-rw-r–r–   1 crifan  staff        26  5 14 23:14 Cartfile

-rw-r–r–@  1 crifan  staff        34  5 14 23:14 Cartfile.resolved

drwxr-xr-x   4 crifan  staff       136  5 14 15:16 Carthage

-rw-r–r–   1 crifan  staff  29364293  5 14 23:10 Charts.framework.zip

-rw-r–r–   1 crifan  staff       247  5 16 10:43 Podfile

-rw-r–r–   1 crifan  staff       202  5 12 16:10 Podfile.lock

drwxr-xr-x   9 crifan  staff       306  5 16 10:40 Pods

drwxr-xr-x  16 crifan  staff       544  5 16 10:28 QorosSales

drwxr-xr-x@  5 crifan  staff       170  5 15 17:00 QorosSales.xcodeproj

drwxr-xr-x   4 crifan  staff       136  5 12 16:15 QorosSales.xcworkspace

drwxr-xr-x   4 crifan  staff       136  5 12 15:40 QorosSalesTests

drwxr-xr-x   4 crifan  staff       136  5 12 15:40 QorosSalesUITests

drwxr-xr-x   3 crifan  staff       102  5 14 23:08 build

licrifandeMacBook-Pro:QorosSales crifan$ pod install

Re-creating CocoaPods due to major version update.

Analyzing dependencies

Downloading dependencies

Generating Pods project

Integrating client project

Sending stats

Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.

[!] The Podfile does not contain any dependencies.

然后回到Xcode中,也看不到pod下面的那个原有的charts库了:

好像这么就可以了。

[总结]

如果只是想要,把之前cocoapods中管理的一个库,去掉,那么很简单:

从Pod file中移除对应的行

然后再去pod install,即可。

如果想要把项目中,整个的cocoapods移除掉,则可以参考:

xcode – How to remove CocoaPods from a project? – Stack Overflow

转载请注明:在路上 » [记录]将一个库Charts从Cocoapods中移除掉

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
93 queries in 0.172 seconds, using 23.30MB memory