Delete all related pod files:
and in the Project Navigator:
Click on the project name (blue icon) --> Targets (*) --> Build Phases --> Remove "[CP] Check Pods manifests.lock" (click on the "x")
(*) Click on the project name, you might have to click on "Show project and target list" to see the side bar first.
Podfile
, Podfile.lock
, the Pods
folder, and the generated workspace..xcodeproj
, remove the references to the Pods.xcconfig
files and the libPods.a
file.Pods.framework
.The only thing you may want to do is include some of the libraries that you were using before. You can do this by simply draging whatever folders where in the pods folders into your project (I prefer to put them into my Supporting Files folder).
It worked for me.
I was able to remove my pods in the project using the CocoaPods app (Version 1.5.2). Afterwards I only deleted the podfile, podfile.lock and xcworkspace files in the folder.
From terminal cd to move to the project folder. The below steps help to de-integrate the pod from the project
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod clean
$ rm Podfile
Then just open the project file and remove the Pod folder if it is still on the Project Explorer with red color. Build the project
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod clean
$ rm Podfile
I tried all these answers but it still wouldn't build, eventually I tried:
pod deintegrate
pod install
which actually worked!
It's like it needs to remove all the pod scripts from your build phases and re-add them back in for it to work, at least in my case.
pod deintegrate
After this cmd, no traces of Cocoapods left in your project.
But your workspace referencing the Pods project still remains, you need to should remove below 3 files manually:
xx.xcworkspace
Podifle
Podfile.lock
Then you can use your project again.
Have fun!
Test CocoaPod version = 1.2.0
There can be two aspects developer may face.
In first case you have to use 'pod deintegrate' and follow several steps which are mentioned in the answers above.
For second case that is if you want to uninstall any particular framework which is installed there very simple way available in your pod file just comment the framework which you want to uninstall and run pod install command.
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ProjectName' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'iCarousel', '~> 1.8'
# pod 'Facebook-iOS-SDK', '~> 4.1'
# pod 'ParseFacebookUtilsV4', '~> 1.11'
# pod 'Parse', '~> 1.14'
end
Here I want to uninstall facebook and parse frameworks (which were installed using pods) and not iCarousel that is why I have updated my pod file like above.
Now if I run pod install it will keep iCarousel as it is in my project and will remove facebook and parse.
I don't think you need to deintegrate anymore. I was able to do it with the following command in terminal:
pod install
and it automatically removed the ones that are no longer in the podfile
Use these Terminal's commands (Don't forget to use sudo at the beginning of new lines):
open:YourDir YouName$ sudo gem uninstall cocoapods
Password:?
Remove executables:
pod, sandbox-pod
in addition to the gem? [Yn] Y
Removing pod
Removing sandbox-pod
Successfully uninstalled cocoapods-1.4.0
open:YourDir YourName$ gem list --local | grep cocoapods
cocoapods-core (1.4.0)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.1.3)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.3.0)
cocoapods-try (1.1.0)
Uninstall the list one by one like this:
open:YourDir YourName$ sudo gem uninstall cocoapods-core
Successfully uninstalled cocoapods-core-1.4.0
open:YourDir YourName$ sudo gem uninstall cocoapods-trunk
Successfully uninstalled cocoapods-trunk-1.3.0
open:YourDir YourName$ sudo gem uninstall cocoapods-try
Successfully uninstalled cocoapods-try-1.1.0
open:YourDir YourName$ gem list --local | grep cocoapods
open:YourDir YourName$ sudo gem uninstall cocoapods-stats
Successfully uninstalled cocoapods-stats-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-search
Successfully uninstalled cocoapods-search-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-downloader
Successfully uninstalled cocoapods-downloader-1.1.3
open:YourDir YourName$ sudo gem uninstall cocoapods-plugins
Successfully uninstalled cocoapods-plugins-1.0.0
open:YourDir YourName$ gem list --local | grep cocoapods
cocoapods-deintegrate (1.0.2)
open:YourDir YourName$ sudo gem uninstall cocoapods-deintegrate
Successfully uninstalled cocoapods-deintegrate-1.0.2
open:YourDir YourName$ sudo gem uninstall cocoapods-stats
Successfully uninstalled cocoapods-stats-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-search
Successfully uninstalled cocoapods-search-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-downloader
Successfully uninstalled cocoapods-downloader-1.1.3
open:YourDir YourName$ sudo gem uninstall cocoapods-plugins
Successfully uninstalled cocoapods-plugins-1.0.0
open:YourDir YourName$ gem list --local | grep cocoapods
cocoapods-deintegrate (1.0.2)
open:YourDir YourName$ sudo gem uninstall cocoapods-deintegrate
Successfully uninstalled cocoapods-deintegrate-1.0.2
I am gonna write what iv done very briefly (to delete any CocoaPods from my project)..
To remove the framework reference from xcode:
If you just want to remove one pod and keep others you may have installed, open the podfile in your app directory and delete the one you want to remove. Then navigate to your app directory using terminal and type:
pod update
This will remove the pod you removed from the podfile. You will see it has been removed in the terminal:
Analyzing dependencies
Removing FirebaseUI
Removing UICircularProgressRing
Note that this method will also pull any updates to the other pods in your podfile. You may or may not want that.
If not work, try
1. clean the project.
2. deleted derived data.
if you don't know how to delete derived data go here
I think there's a more easy way to do that.
As edited by the accepted answer, now you can use a third party plugin cocoapods-deintegrate, it's reliable because its made by a CocoaPods core team member.
But,there're still some files remain:
Podfile
Podfile.lock
Workspace
You could remove them from your project manually,but there's also another tool for helping you to clean them, thanks cocoapods-clean.
Finally, the uninstallation work is still not completed, cocoapods-clean
don't clean the Podfile
, just run:
rm Podfile
Cheers!
Before removing you should ensure you have a backup of your project!
Keith's answer is great - I just want to point out that because Cocoapods 0.36 is starting to support Dynamic Frameworks, if you are using 'use_frameworks!' in your 'Podfile' and you wish to remove the Cocoapods, you must do this:
Build Phases
delete Embed Pods Frameworks
phase.pod deintegrate
and pod clean
are two designated commands to remove CocoaPod from your project/repo.
Here is the complete set of commands:
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod cache clean --all
$ rm Podfile
The original solution was found here: https://medium.com/@icanhazedit/remove-uninstall-deintegrate-cocoapods-from-your-xcode-ios-project-c4621cee5e42#.wd00fj2e5
CocoaPod documentation on pod deintegrate
: https://guides.cocoapods.org/terminal/commands.html#pod_deintegrate
To remove pods from a project completely you need to install two thing first...those are follows(Assuming you have already cocoa-pods installed in your system.)...
Installation
Cocoapods-Deintegrate Plugin
Use this following command on your terminal to install it.
sudo gem install cocoapods-deintegrate
Cocoapods-Clean Plugin
Use this following command on your terminal to install it.
sudo gem install cocoapods-clean
Usage
First of all goto your project folder by using the as usual command like..
cd (path of the project) //Remove the braces after cd
Now use those two plugins to remove it completely as follows..
Cocoapods-Deintegrate Plugin
Use this following command on your terminal to deintegrate the pods from your project first.
pod deintegrate
Cocoapods-Clean Plugin
After deintegration of pod from your project use this following command on your terminal to clean it completely.
pod clean
After completing the above tasks there should be the Podfile still remaining on your project directory..Just delete that manually or use this following command on the terminal..
rm Podfile
Thats it...Now you have your project free from pods...Cleaned.
Removing Cocoapods from the system.
Any way try to use the following command on your terminal to uninstall/remove the coca-pods from your system.
sudo gem uninstall cocoapods
It will remove the coca-pods automatically.
Thanks. Hope this helped.
podfile
name from .plist
Source: Stackoverflow.com