尝试直接删除整个缓存,需要花费大量时间才能找回所有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在使用cocoapods1.3.1
Xcode9
的项目中的大小> 1.5 GB 1}}。
答案 0 :(得分:56)
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?
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install