How to remove CocoaPods from a project?

前端 未结 19 1326
深忆病人
深忆病人 2020-11-22 05:17

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

相关标签:
19条回答
  • 2020-11-22 05:38

    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

    0 讨论(0)
  • 2020-11-22 05:39

    Delete all related pod files:

    • xx.xcworkspace
    • Podfile
    • Podfile.lock

    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.

    0 讨论(0)
  • 2020-11-22 05:40

    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 xcodeprojs 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.

    1. Delete the standalone files (Podfile Podfile.lock and your Pods directory)
    2. Delete the generated xcworkspace
    3. Open your xcodeproj file, delete the references to Pods.xcconfig and libPods.a (in the Frameworks group)
    4. Under your Build Phases delete the Copy Pods Resources, Embed Pods Frameworks and Check Pods Manifest.lock phases.
    5. 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.

    0 讨论(0)
  • 2020-11-22 05:40
    1. The first thing that you will need to do is remove the Podfile, Podfile.lock, the Pods folder, and the generated workspace.
    2. Next, in the .xcodeproj, remove the references to the Pods.xcconfig files and the libPods.a file.
    3. Within the Build Phases project tab, delete the Check Pods Manifest.lock section (open), Copy Pods Resources section (bottom) and Embed Pod Resources(bottom).
    4. Remove 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.

    0 讨论(0)
  • 2020-11-22 05:41

    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.

    0 讨论(0)
  • 2020-11-22 05:43

    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.)...

    1. Cocoapods-Deintegrate Plugin
    2. Cocoapods-Clean Plugin

    Installation

    1. Cocoapods-Deintegrate Plugin

      Use this following command on your terminal to install it.

      sudo gem install cocoapods-deintegrate
      
    2. 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..

    1. Cocoapods-Deintegrate Plugin

      Use this following command on your terminal to deintegrate the pods from your project first.

       pod deintegrate
      

    1. 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.

    0 讨论(0)
提交回复
热议问题