2017-09-26 1483 views
4

如何從cocoapods緩存中清除特定的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從緩存中讀取舊版本。當容器較大,目前使用的吊艙中的一個具有> 1.5 GB的大小在使用cocoapods1.3.1Xcode9項目

有在羣緩存相同羣的許多情況下,可能會很麻煩。

+0

只需將其從pod文件中刪除並更新即可。你想要做什麼? – Desdenova

+0

@Desdenova,只是從podfile中刪除和'pod update'不能從緩存中清除它。 – lal

回答

5

清除特定吊艙的pod cache clean 'FortifySec'

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

示例輸出,對於盒未使用語義版本,這可能會導致緩存相同羣的多個副本:

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` 
+1

'pod cache clean --all'#將清除所有的豆莢 –