美文网首页
CocoaPods使用及常见问题

CocoaPods使用及常见问题

作者: ldldlkdldld | 来源:发表于2016-07-14 20:37 被阅读31次

需要注意的地方

  • 使用CocoaPods进行依赖管理后,启动项目需要打开xcworkspace文件而非
    xcodeproj文件。

FAQ

  1. 如何从项目中移除CocoaPods?
    略复杂。

参考:http://stackoverflow.com/questions/16427421/how-to-remove-cocoapods-from-a-project

  • 如何从项目中移除CocoaPods中的某个已经安装的库?
    在Podfile中移除该库对应的声明,然后执行下面的命令进行更行即可。
pod install

参考:http://stackoverflow.com/questions/13751147/remove-or-uninstall-library-previously-added-cocoapods

  • 添加新的pod后,如何只安装新添加的pod,不影响本地的其他pod?

    pod install --no-repo-update
    
  • 如何只更新特定的pod

pod update POD_NAME

下面命令在更新时指定pod版本

pod 0.38.2 update POD_NAME --no-repo-update


- 安装提示『ERROR:  While executing gem ... (Errno::EPERM)
  Operation not permitted - /usr/bin/pod』

sudo gem install -n /usr/local/bin cocoapods


- 执行特定版本的cocoapods,比如0.38.0

pod 0.38.0 install


- 安装老版本的CocoaPods

sudo gem install cocoapods -v 1.0.0


### 错误及解决

1. Specs satisfying the `FLEX (from `https://github.com/Flipboard/FLEX`, tag `2.4.0`)` dependency were found, but they required a higher minimum deployment target.

Podfile里面target platform版本过低,需要指定更高的版本,这种情况通常需要安装低版本的库,或修改工程的部署系统版本。

相关文章

网友评论

      本文标题:CocoaPods使用及常见问题

      本文链接:https://www.haomeiwen.com/subject/inzejttx.html