IOS Cocoapods automatically manage third-party open source libraries

Source: Internet
Author: User
Tags install cocoapods

Recently found in the development of a lot of third-party libraries used in the project, but the third-party updates when the local can not be updated in a timely manner. However, Cocoapods can manage updates to third-party dependent packages, which will save a lot of time, as described below for the installation and use of Cocoapods

Installation of 1.CocoaPods

1.0.0. The gem command line in Ruby is generally upgraded as follows:

1.0.1. Cocoapods installation is as simple as this:

$ sudo gem install Cocoapods

$ pod Setup

Note: When pod setup executes, it will output setting up CocoaPods master repo, wait a long time, use CD ~/.cocoapods to enter this directory, and then use DU-SH * To view the download progress

Use of 2.CocoaPods

2.0.0. Find the third-party library you want to manage, such as AFN, enter the following command line:

$ pod Search AFN

2.0.1.: Enter the project directory of your choice, then create a Podfile folder and enter the name of the dependent library in the folder:

$ cd Project folder path

$ vim Podfile

Note: Vim is entered in the edit state, enter the following command, then press ESC to save, and then enter: Wq Write and exit

2.0.2.: Place the edited Podfile file in the project root directory and execute the following command:

$ pod Install

Note: Cocoapods the generated *.xcworkspace file to open the project, not the previous *.xcodeproj file, and each time you change the Podfile file, you need to re-execute a The secondary pod Update command ....

IOS Cocoapods automatically manage third-party open source libraries

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.