打开终端,输入命令:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
根据提示完成安装(有可能安装失败,将路径修改为 /usr/local/bin , 没有失败按照正常流程
)
安装结束后输入 brew, 会出现相应的提示命令:
Example usage:
brew [info | home | options ] [FORMULA...]
brew install FORMULA...
brew uninstall FORMULA...
brew search [foo]
brew list [FORMULA...]
brew update
brew upgrade [FORMULA...]
brew pin/unpin [FORMULA...]
Troubleshooting:
brew doctor
brew install -vd FORMULA
brew [--env | config]
Brewing:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]
https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md
Further help:
man brew
brew home
brew install carthage
出现:
==> Downloading https://homebrew.bintray.com/bottles/carthage-0.15.2.el_capitan.
######################################################################## 100.0%
==> Pouring carthage-0.15.2.el_capitan.bottle.tar.gz
�� /usr/local/Cellar/carthage/0.15.2: 37 files, 11.9M
安装成功,继续输入命令 carthage 出现
Available commands:
archive Archives built frameworks into a zip that Carthage can use
bootstrap Check out and build the project's dependencies
build Build the project's dependencies
checkout Check out the project's dependencies
copy-frameworks In a Run Script build phase, copies each framework specified by a SCRIPT_INPUT_FILE environment variable into the built app bundle
fetch Clones or fetches a Git repository ahead of time
help Display general or command-specific help
update Update and rebuild the project's dependencies
version Display the current version of Carthage
表示安装成功.在mac 某个目录下新建一个文件夹取名 Carthage,终端进入该文件夹
cd /Users/XXXX/Carthage
终端输入命令
vim Cartfile
能生成一个Cartfile的文件,输入 i 进行编辑,输入所需要的第三方库例如: github "Alamofire/Alamofire" ~> 3.0 按 esc 退出,输入冒号":",继续输入 wq 结束
终端输入
carthage update
出现
*** Cloning Alamofire
*** Checking outAlamofire at "3.3.0"
*** xcodebuild output can be found in/var/folders/bt/s3tsn68n7mg3x04fnhkxq7wm0000gn/T/carthage-xcodebuild.7U0poN.log
*** Building scheme"Alamofire OSX" in Alamofire.xcworkspace
*** Building scheme"Alamofire tvOS" in Alamofire.xcworkspace
*** Building scheme"Alamofire watchOS" in Alamofire.xcworkspace
*** Building scheme"Alamofire iOS" in Alamofire.xcworkspace
表示引用的第三方库成功将生成的 framework 引入所需要的工程中