First, the installation and use of Carthage
1. After installing homebrew, enter the following command
" $ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install) "
2. Upgrade Brew
$ Brew Update
3. Use Brew to install
Brew Install Carthage
Carthage version
Second, the use of Carthage
1) Go to the folder where the project is located
$ cd Project Path
2) Create an empty Carthage file
$ Touch Cartfile
$ vim Cartfile
3) Edit the Cartfile file
" Alamofire/alamofire " "Snapkit/snapkit " "Devxoul/then"
4) Save and close the Cartfile file and use the Cartfile installation framework
$ Carthage Update--platform IOS
5) Open Carthage View the production file directory
$ open Carthage
File Directory Description:
"|| Carthage/checkouts Directory: Source code obtained from GitHub
"|| Carthage/build directory: Compiled framework binary code library
3, about Carthage compiled library is very simple to use, you can manually drag the framework files in the Carthage/build directory into the project:
You can also use scripts to automatically copy the framework to your project each time you compile:
Note: When writing the framework copy path must be written correctly, the default is the project root directory/carthage/build/ios/, there is also need to note that when the AppStore upload, this script will be audited error, it is not recommended to use this method; In addition, in xcode9+ , there will be real-time compilation problems, resulting in system CPU flying, serious energy consumption, use with caution.
4. Other:
Uninstall Carthage:Brew Uninstall Carthage update third-party framework: Update multiple frames: Modify Cartfile file and re-execute Carthage update
Update a FRAME: $ Carthage Update Specific frame name
IOS Carthage Installation, use