brew intsall carthage
vim Cartfile
>= 1.0
for 「at least version 1.0」 1.0以上~> 1.0
for 「compatible with version 1.0」 最好是1.0,== 1.0
for 「exactly version 1.0」 必須是1.0# Require version 2.3.1 or later github "ReactiveCocoa/ReactiveCocoa" >= 2.3.1 # Require version 1.x github "Mantle/Mantle" ~> 1.0 # (1.0 or later, but less than 2.0) # Require exactly version 0.4.1 github "jspahrsummers/libextobjc" == 0.4.1 # Use the latest version github "jspahrsummers/xcconfigs" # Use the branch github "jspahrsummers/xcconfigs" "branch" # Use a project from GitHub Enterprise github "https://enterprise.local/ghe/desktop/git-error-translations" # Use a project from any arbitrary server, on the "development" branch git "https://enterprise.local/desktop/git-error-translations2.git" "development" # Use a local project git "file:///directory/to/project" "branch"
爲了簡單我只添加了一個 Ps:第一行爲註釋html
#Require version 2.0.0 github "Alamofire/Alamofire" ~> 2.0.0
carthage update
*** Cloning Alamofire *** Checking out Alamofire at "2.0.2" *** xcodebuild output can be found in /var/folders/ps/vkznbcf51bd56ld8j4cby_5m0000gp/T/carthage-xcodebuild.kTo8yR.log *** Building scheme "Alamofire watchOS" in Alamofire.xcworkspace *** Building scheme "Alamofire OSX" in Alamofire.xcworkspace *** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
/usr/local/bin/carthage copy-frameworks
$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework