Use Carthage (Replacement of cocoapods), carthagecocoapods

Source: Internet
Author: User

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.0For "at least version 1.0" 1.0 or above
  • ~> 1.0For "compatible with version 1.0", preferably 1.0,
  • == 1.0For "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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.