How to remove Cocoapods from your project

Xcode Cocoapods App Development

Cocoapods serve us well for years, but Swift Package Manager (SPM) is getting better and better recently. If you are the one who wants to adopt SPM and say goodbye to our old friend, this is how to do it right.

[sudo] gem install cocoapods-deintegrate
pod deintegrate

The only things that will remain from pod deintegrate are as follows:

  • Podfile
  • Podfile.lock
  • Workspace

You can manually remove those files.

Too lazy

If you are too lazy to remove those files, there is cocoapods-clean gem, which will remove Podfile.lock, Pods/ and *.xcworkspace for you. The only thing left is Podfile, which you can remove it with remove command rm.

[sudo] gem install cocoapods-deintegrate cocoapods-clean
pod deintegrate
pod clean
rm Podfile

Your project is now Cocoapods free and ready for a shiny SPM.

If you enjoy this article, you can subscribe to the weekly newsletter.

Every Friday, you’ll get a quick recap of all articles and tips posted on this site — entirely for free.


← Home