6

Cocoapods 源码浅析 - 从 pod 命令开始

 4 years ago
source link: http://saitjr.com/ios/cocoapods-start-with-pod-command.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

当看到这篇博客,相信你已经不再困惑与 Cocoapods 如何使用,而是 Cocoapods 是如何实现的。我也有这样的好奇,其实 Cocoapods 源码一直在断断续续的读,决定好好梳理一下。

环境信息

Cocoapods 1.9.0.beta.2 (f1293b7)

Core 1.9.0.beta.2 (95e133d)

快过年了,01.22 之前完成。

目标

先从最简单的日常使用来看,比如项目引入 AFNetworkingSDWebImage

  1. 执行 pod init 生成 Podfile(或者自己创建一个 Podfile)
  2. 书写 Podfile
  3. 执行 pod install (除此之外,还有一个命令叫 pod update
  4. 打开 .xcworkspace ,结束

比较感兴趣的是:

  1. Podfile 是什么?(之前写了一篇Podfile 解析最佳实践 有提到 Podfile 是什么,以及如何自己解析 Podfile,所以这篇文章不会再提)
  2. pod install 做了什么事情?
  3. .xcworkspace 是如何生成的?
  4. pod installpod update 有什么区别?
  5. 生成的新文件中,还有一个叫 Podfile.lock ,它的作用是什么?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK