Uninstall/remove Carthage from iOS/Xcode project?

I have almost spent a week and now can say to remove Carthage safely and without any side effects there are following step by step process

  1. It's better to do it step by step, means if you have installed four (4) frameworks using Carthage just go by removing one framework at a time and after each removal successfully build and run on device and simulator to see the final result. And even if you need any framework out of those 4 first delete, clean your project and then reinsert the needed framework in your project using another mechanism you want.
    1. From ProjectNavigator > Build Phases remove the reference of the framework
    2. From Cartfile & Cartfile.resolved remove all references of the frameworks and save
    3. Remove Framework from the left-hand side of the project navigator (where you see the entire file structure) by selecting the framework and pressing delete. On being given the option by Xcode select remove all references
    4. Go to terminal and cd/Path to. your project
    5. Run the command Carthage update --platform iOS (platform you have to choose as per what project is meant for so if iOS select iOS or else select as per your choice)
    6. Let the Carthage download all dependencies again
    7. Build & Run
    8. Repeat steps from 2 to 8 till you have no framework left
    9. Search in Finder a).Cartfile b).Cartfile.resolved c). Carthage/

Delete all of these and again clean and build your project.


Removing Carthage has actually been pretty easy for me.

  1. I simply copy my frameworks from the Carthage folder into a frameworks folder I have in my main project folder.
  2. Make sure they are added back to the Xcode project from their new location.
  3. Search the entire project in Find navigator for references to Carthage. The only ones I found were in the Frameworks search paths under Build Settings. As long as you have a reference to your non-Carthage frameworks folder, you should be able to delete the Carthage references.
  4. Lastly, remove the copy-frameworks run script put in place to keep your Carthage frameworks up to date. Simply click the x in the top right run script phase xcode

You should always be able to add Carthage back if you want, but these steps should remove it from a particular Xcode project, while keeping the frameworks you want.


To completely remove Carthage and its frameworks from project:

  1. In Finder, delete these files and directory from your project's root folder:

     Cartfile
     Cartfile.resolved
     Carthage/
    
  2. In Xcode, delete the framework item in the project navigator.

  3. In Xcode > project Target > Build Phases tab (illustration), delete the carthage copy-frameworks Run Script (if you had previously added it).

You can always download the framework you need from github and add it back in manually. (Or follow @tfrank377's answer).

See also

  • Carthage Tutorial: Getting Started
  • Carthage documentation