0x01, first install OSX Suite manager homebrew
Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"
0x02, use Homebrew for installation Carthage Update the Homebrew before installing it may be installed to older versions of Carthage
Brew Update
0x03, Homebrew installation Carthage
Brew Install Carthage
The Carthage tool has been installed here.
Here's how to get started with the Carthage Tool Management Pack (Carthage is written by the Swift language, supports only dynamic frames and supports only ios8+. Currently only supports GitHub or GIT-related management source libraries)
0x04, add cartfile file notation official example (HTTPS://GITHUB.COM/CARTHAGE/CARTHAGE/BLOB/MASTER/DOCUMENTATION/ARTIFACTS.MD)
such as: GitHub "Reactivecocoa/reactivecocoa" >= 2.3.1
0x05, re-execute the carthage update ;在执行 carthage update 命令后会在根目录创建一个 Cartfile.resolved 文件,这个文件是生成后的依赖关系,不能修改,同时还会生成一个 Carthage folder inside the compiled. Framework File
- The Cartfile file is used to annotate which dependent libraries you need, the corresponding version, or the Git branch (to commit to Git)
- The cartfile.resolved file is used to track the dependent version number currently used by the project, in order to keep the multi-terminal development consistent (commit to Git)
- The Carthage folder is used to store source files and compiled files that depend on the library (no need to commit to Git)
0X06, put the compiled. framework file into the Bild phases under link Binary with libraries and general in embedded binaries
0x07, add Modify. gitignore file add Carthage as suddenly folder
Example: Https://github.com/yanyan1119/TestCarthage
Installing and using Carthage