如何清除或清除特定的pod缓存

如何从cocoapods缓存中删除或清除特定的pod?

试图直接删除整个缓存,需要花费大量时间来取回所有pod。 如何从缓存中查看和删除特定的pod?

以下工作(更长时间提交):

# delete all cached pods `rm -rf "${HOME}/Library/Caches/CocoaPods"` # delete local Pods/* rm -rf "`pwd`/Pods/" # pod update to fetch latest. After entire cache deletion, it takes lot longer to fetch and rebuild pod cache from scratch. `pod update` 

只需从podfile中注释掉, pod install再次从缓存中获取旧版本。

当pod很大时,在pod缓存中有许多相同pod的实例可能很麻烦,当前使用的pod中的一个在使用带有Xcode9 cocoapods1.3.1的项目中具有> 1.5 GB的大小。

清除特定的pod

 `pod cache clean --all` # will clean all pods `pod cache clean 'FortifySec' --all` # will remove all installed 'FortifySec' pods 

pod cache clean 'FortifySec'示例输出,对于不使用语义版本控制的pod,这可能会导致缓存中相同pod的许多副本:

 pod cache clean 'FortifySec' 1: FortifySec v2.2 (External) 2: FortifySec v2.2 (External) ... ... 18: FortifySec v2.2 (External) 19: FortifySec v2.2 (External) Which pod cache do you want to remove? 

完全清理(pod重置)

 1. `rm -rf ~/Library/Caches/CocoaPods` 2. `rm -rf Pods` 3. `rm -rf ~/Library/Developer/Xcode/DerivedData/*` 4. `pod deintegrate` 5. `pod setup` 6. `pod install`