How to clear or clean specific pod from the local cocoapods cache
Clearing a specific pod
pod cache clean --all # will clean all pods
pod cache clean 'FortifySec' --all # will remove all installed 'FortifySec' pods
Sample output of pod cache clean 'FortifySec'
, for pods not using semantic versioning, this could result in many copies of same pod in 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 cleanup (pod reset)
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install
Example of pod cache list
prior to clean
pod cache list
FortifySec:
- Version: 2.2.1
Type: External
Spec: /Users/j.d/Library/Caches/CocoaPods/Pods/Specs/External/FortifySec/ui99sd....podspec.json
Pod: /Users/j.d/Library/Caches/CocoaPods/Pods/External/FortifySec/yi23sd...-sdjc3
- Version: 2.2.1
Type: External
Spec: /Users/j.d/Library/Caches/CocoaPods/Pods/Specs/External/FortifySec/dsfs-df23
Pod: /Users/j.d/Library/Caches/CocoaPods/Pods/External/FortifySec/dfs0d-2dfs
- Version: 2.2
Type: External
Spec: /Users/j.d/Library/Caches/CocoaPods/Pods/Specs/External/FortifySec/u78hyt....podspec.json
Pod: /Users/j.d/Library/Caches/CocoaPods/Pods/External/FortifySec/e000sd
- Version: 2.2.2
Type: External
Spec: /Users/j.d/Library/Caches/CocoaPods/Pods/Specs/External/FortifySec/s2d-df.podspec.json
Pod: /Users/j.d/Library/Caches/CocoaPods/Pods/External/FortifySec/ds34sd....
- Version: 2.2.1
Type: External
Spec: /Users/j.d/Library/Caches/CocoaPods/Pods/Specs/External/FortifySec/sdfsdfdsf....podspec.json
Pod: /Users/j.d/Library/Caches/CocoaPods/Pods/External/FortifySec/edfs5d7...
AFNetworking:
- Version: 2.5.3
Type: Release
Spec: /Users/j.d/Library/Caches/CocoaPods/Pods/Specs/Release/AFNetworking/2.6.podspec.json
Pod: /Users/j.d/Library/Caches/CocoaPods/Pods/Release/AFNetworking/2.6.3-4e7e2
Notice the multiple pod cache for - Version: 2.2.1
. It's a good idea to do so to get rid of unnecessary disk space used by pod cache.
How do I remove Cocoapod pods from a Flutter project?
Turns out the correct way to install and remove pods from a Flutter project is just to edit the pubspec.yaml
file in the root directory!
Cocoapods needs to be installed, but it will automatically read the pubspec.yaml
file and do the work from there! No need to run pod
commands from terminal or otherwise.
How to remove CocoaPods from a project?
Removing CocoaPods from a project is possible, but not currently automated by the CLI. First thing, if the only issue you have is not being able to use an xcworkspace
you can use CocoaPods with just xcodeproj
s by using the --no-integrate
flag which will produce the Pods.xcodeproj
but not a workspace. Then you can add this xcodeproj
as a subproject to your main xcodeproj
.
If you really want to remove all CocoaPods integration you need to do a few things:
NOTE editing some of these things if done incorrectly could break your main project. I strongly encourage you to check your projects into source control just in case. Also these instructions are for CocoaPods version 0.39.0
, they could change with new versions.
- Delete the standalone files (
Podfile
Podfile.lock
and yourPods
directory) - Delete the generated
xcworkspace
- Open your
xcodeproj
file, delete the references toPods.xcconfig
andlibPods.a
(in theFrameworks
group) - Under your
Build Phases
delete theCopy Pods Resources
,Embed Pods Frameworks
andCheck Pods Manifest.lock
phases. - This may seem obvious but you'll need to integrate the 3rd party libraries some other way or remove references to them from your code.
After those steps you should be set with a single xcodeproj
that existed before you integrated CocoaPods. If I missed anything let me know and I will edit this.
Also we're always looking for suggestions for how to improve CocoaPods so if you have an issues please submit them in our issue tracker so we can come up with a way to fix them!
EDIT
As shown by Jack Wu in the comments there is a third party CocoaPods plugin that can automate these steps for you. It can be found here. Note that it is a third party plugin and might not always be updated when CocoaPods is. Also note that it is made by a CocoaPods core team member so that problem won't be a problem.
Remove or uninstall library previously added : cocoapods
The unwanted side effects of simple folder delete or installing over existing installation have been removed by a script written by Kyle Fuller - deintegrate and here is the proper workflow:
Install clean:
sudo gem install cocoapods-clean
Run deintegrate in the folder of the project:
pod deintegrate
Clean(this tool is no longer available):pod clean
Modify your podfile (delete the lines with the pods you don't want to use anymore) and run:
pod install
Done.
Related Topics
Could Not Cast Value of Type 'Uitableviewcell' to '(Appname).(Customcellname)'
iOS Check If Application Has Access to Microphone
Ios: One Ibaction for Multiple Buttons
Xcode 10 Build Fails with 'Command Compileswift Failed with a Nonzero Exit Code
How Detect Swipe Gesture Direction
How to Convert Uicolor Value to a Named Color String
Get Name of Airplay Device Using Avplayer
Cannot Assign to Property in Protocol - Swift Compiler Error
How to Install iOS 7.0 and iOS 8.0 Simulators in Xcode 6.1
How to Get the Front Camera in Swift
Path Extension and Mime Type of File in Swift
Can't Load Uiviewcontroller Xib File in Storyboard in Swift
Does Webkit in iOS 11 (Beta) Support Webrtc
Uiactionsheet Cancel Button Strange Behaviour
iOS 7 Uitableview: How to Remove Space Between Navigation Bar and First Cell