Use Carthage (Replacement of cocoapods), carthagecocoapods
1. Use homebrew to install Carthage
brew intsall carthage
Ps: If Homebrew is not installed, enter the portal Homebrew. By the way, you can select Simplified Chinese. 2. Go to Project Creation
vim Cartfile
An example of Cartfile content is as follows:
>= 1.0
For "at least version 1.0" 1.0 or above
~> 1.0
For "compatible with version 1.0", preferably 1.0,
== 1.0
For "exactly version 1.0" must be 1.0
- Do not write anything. The default version is the latest version.
# Require version 2.3.1 or latergithub "ReactiveCocoa/ReactiveCocoa" >= 2.3.1# Require version 1.xgithub "Mantle/Mantle" ~> 1.0 # (1.0 or later, but less than 2.0)# Require exactly version 0.4.1github "jspahrsummers/libextobjc" == 0.4.1# Use the latest versiongithub "jspahrsummers/xcconfigs"# Use the branchgithub "jspahrsummers/xcconfigs" "branch"# Use a project from GitHub Enterprisegithub "https://enterprise.local/ghe/desktop/git-error-translations"# Use a project from any arbitrary server, on the "development" branchgit "https://enterprise.local/desktop/git-error-translations2.git" "development"# Use a local projectgit "file:///directory/to/project" "branch"
For simplicity, I added only one Ps: The first behavior comment.
#Require version 2.0.0github "Alamofire/Alamofire" ~> 2.0.0
3. Terminal Operation
carthage update
The result of running carthage update is as follows:
*** 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
The file directories are as follows. The Cartfile, Cartfile. resolved, and Carthage folders are created with Carthage.
4. Open the Carthage folder and enter Bulid. Take iOS as an example. Go to the iOS folder and find Alamofire. drag the framework to the project or select Target-> Build Phases-> Link Library with Librarie in the project, click +, and then click add Other in the lower left corner .. find. Add the framework. 5. Add the Script in Build Phases-> + (upper left corner)-> New Run Script Phase. Then click Run Script to add the Script.
/usr/local/bin/carthage copy-frameworks
Add "Input Files" (using Alamofire as an example)
$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework
As shown in: the added script runs when the App Store submits a general binary trigger bug, ensuring that necessary bitcode-related files are copied during archiving. This script works around und an App Store submission bug triggered by universal binaries and ensures that necessary bitcode-related files are copied when archiving. note that Carthage supports OS X versions, but only officially supports dynamic frameworks is supported for iOS 8 and later versions. dynamic frameworks can be used on any version of OS X, but only on iOS 8 or later. add Carthage github address: https://github.com/Carthage/Carthage