How to clear or clear a specific module from Cocoapods local cache

How to remove or clear a specific module from Cocoapods cache?

Trying to delete the entire cache directly takes a long time to return all the modules. How to view and delete a specific module from the cache?

The following works (longer lead time):

# 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' 

Just comment from the subfile, and pod install again selects the old version from the cache.

Having a large number of instances of the same module in the module cache can be problematic when the module is large. One of the modules used is> 1.5 GB in size in a project that uses cocoapods1.3.1 with Xcode9 .

+28
source share
1 answer

Cleaning a specific module

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

Example output pod cache clean 'FortifySec' , for modules that do not use semantic version control, this can lead to multiple copies of the same module in the cache:

 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? 

Complete cleaning (module reset)

 rm -rf ~/Library/Caches/CocoaPods rm -rf Pods rm -rf ~/Library/Developer/Xcode/DerivedData/* pod deintegrate pod setup pod install 
+76
source

Source: https://habr.com/ru/post/1272134/


All Articles