如何删除与 CocoaPods 一起安装的库?

How to remove library installed with CocoaPods?

我正在尝试完全删除我使用 CocoaPods 安装的库。

我已从我的 Podfile 中删除条目并从终端调用 pod install

所有的库文件似乎都被删除了,但我仍然可以在我的 iOS Swift 项目中执行 import myLibrary 而没有任何构建错误。

为什么会这样?

尝试清理您的项目。

或使用分解

 $ gem install cocoapods-deintegrate
 $ gem install cocoapods-clean

在您的项目文件夹中

 $ pod deintegrate

 $ pod clean

修改您的 pod 文件(删除您不想再使用的内容)

 $ pod deintegrate

为了完全删除以前构建的项目中的导入,首先尝试clean它:

在Xcode中:

K(或Product > Clean )

这应该从项目 releasedebug 目录中清除编译代码:

/Library/Developer/Xcode/DerivedData/<Project>/Build/(Release or Debug)

如果可以的话,编译器通常会尝试使用在构建过程中已经编译好的代码。