从 cocoapod 项目中只删除一个库,我该怎么做?

Remove only a library from cocoapod project, how i can do?

我有一个应用程序包含两个安装了 cocoapods 的库,Braintree 和 GoogleAnalytics。我想做的是从我的项目中删除 Braintree。这是我项目根目录中的 Podfile:

    # Uncomment this line to define a global platform for your project
    # platform :ios, '7.0'

    target 'MyApp' do

    pod 'Braintree'
    pod 'Google/Analytics'

    end

     target 'MyAppTests' do

      pod 'Braintree'

   end

我试过这个 ,但也许我做错了什么。我的步骤是:打开终端 -> 转到我项目的根目录 -> $ pod update。这个returns对我来说"pod update command not found"。有什么问题或删除 Braintree 库的正确步骤是什么?

尝试运行这个命令

sudo gem intall cocoa pods

然后再次尝试 pod 更新

按照以下方式更新您的 pod 文件

    # Uncomment this line to define a global platform for your project
    # platform :ios, '7.0'

    target 'MyApp' do

    #pod 'Braintree'
    pod 'Google/Analytics'

    end

     target 'MyAppTests' do

      #pod 'Braintree'

   end

在上面的文件中,我对 Braintree 库进行了注释。现在你需要执行 pod updatepod install

由于您遇到 "pod update command not found" 错误,您应该首先按照 答案中的指导在 mac 中安装 cocoapods。