What\'s the right way of removing CocoaPods from a project? I want to remove the whole CocoaPod. Due to some limitations imposed by my client I can\'t use it. I need to have
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
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.
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.
Podfile
Podfile.lock
and your Pods
directory)xcworkspace
xcodeproj
file, delete the references to Pods.xcconfig
and libPods.a
(in the Frameworks
group)Build Phases
delete the Copy Pods Resources
, Embed Pods Frameworks
and Check Pods Manifest.lock
phases.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.
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.
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.
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.