Brew, Carthage Installation

Source: Internet
Author: User
Tags install brew

1. First install Brew

The installation commands are as follows:

CURL-LSSF Http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz-c/usr/local--strip 1

Then execute the following command to get the latest version:

Brew Update

When the brew installation is successful, you can install the software you want, such as Carthage, as follows:

sudo brew install Carthage

If you uninstall, the command is as follows:

sudo brew uninstall Carthage

But this time the installation may report the following error (newly bought computer ...) )

Error:could not Create/usr/local/cellar

Error:permission denied-/library/caches/homebrew/formula/carthage.brewing

Workaround:

Resolve the first error

1, command: sudo chown-r $USER/usr/local

Resolve the second error

2, command: sudo chown-r $USER/library/caches/homebrew/

The final brew install Carthage will wait for the installation to be done silently.

================================================

Next, let's briefly introduce the Brew and Carthage

Brew, also known as homebrew, is the software package management tool on Mac OSX, it can easily install software or uninstall software in Mac, it is very convenient to use only one command.

Brew similar to the Apt-get functions of Ubuntu system

Installing Brew

Brew's official website: http://brew.sh/A detailed description of the use of Brew on the official website

Other Brew commands

Brew List lists installed software

Brew Update Update Brew

Brew Home opens Brew's official website with a browser

Brew Info Displays software information

Brew Deps Show Package dependencies

Carthage's goal is to manage the cocoa third-party framework in the simplest way.

The basic workflow is as follows:

    1. Create a cartfile that contains a list of frames that you want to use in your project

    2. Run Carthage and you will get the frames listed and compile them

    3. Drag-and- .framework drop the compiled binaries into your Xcode project

Carthage compiles your dependencies and provides a framework for the binaries, but you still retain complete control over the structure and settings of the project. Carthage does not automatically modify your project files or compile settings.

the difference between Carthage and Cocoapods

1, cocoapods default will automatically create and update your application and all dependent Xcode workspace,carthage used xcodebuild to compile the framework's binary files

2. The Cocoapods method is easier to use, but the Carthage is more flexible and non-invasive.

3, Cocoapods project must also contain a podspec file, which is the project's metadata, and determine how the project is compiled, Carthage use xcodebuild to compile dependencies

4. Carthage does not have a list of total items, which reduces maintenance and avoids any problems with centrality (such as a central server outage)

Summary: If you use a tool as simple as possible then Carthage it, the Cocoapods function is relatively more, but the use is also relatively troublesome (personal or like to use the Cocoapods)

Start using:

    1. Create a cartfile to list the frames you want to use

    2. Run carthage update , will get the dependent file into a Carthage.checkout folder and then compile each dependent

    3. In the "General" Settings tab of your application target, in the "Embedded Binaries" area, drag the frame from the Carthage.build folder.

In this process, Carthage will create some build artifacts, the most important of which is the Cartfile.lock file, which will list the specific version of each frame, ensuring that you submit the file to the version control tool (like Git, SVN), Because everyone who uses the project needs it to compile the same version of the framework.

By completing the steps above and submitting your changes, the other users of the project simply need to get the repository and execute carthage bootstrap it to use the framework you added.

Brew, Carthage Installation

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.