Macos Catalina Install Cocoapods

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It has over 83 thousand libraries and is used in over 3 million apps. CocoaPods can help you scale your projects elegantly. CocoaPods is built with Ruby and is installable with the default Ruby available on macOS. We recommend you use the default ruby. Install cocoapods to MAC OS; sudo gem install cocoapods. Sudo gem update — system sudo gem install -n /usr/local/bin cocoapods. CocoaPods manages library dependencies for your Xcode projects.

Write a custom catalog title here

Macos Catalina Install Cocoa Pods Free


Because the black apple system was reinstalled on the previous computer, CocoaPods was reconfigured

CocoaPods

What is CocoaPods?

ocoaPods is a tool responsible for managing third-party open source libraries in iOS projects. The source code of the CocoaPods project is managed on GitHub (https://github.com/CocoaPods).

The development of iOS projects inevitably requires the use of third-party open source libraries. When using third-party libraries, in addition to importing source code, integration of these dependent libraries also requires us to manually configure, and when these third-party libraries are updated, we also need It is very troublesome to update the project manually.

The emergence of CocoaPods allows us to save the time of setting up and updating third-party open source libraries. With CocoaPods, we can manage the third-party dependent libraries in a unified manner. Configuration and update only need to be completed with a few simple lines of commands.

Why use CocoaPods?

Before using CocoaPods, when a development project needs to use a third-party open source library, we need to:

Copy the source code of the open source library into the project

Add some dependent frameworks and dynamic libraries

Set -Objc, -fno-objc-arc and other parameters

Manage their updates

After using CocoaPods, we only need to put the used open source libraries in a file named Podfile, and then execute pod update. CocoaPods will automatically download the source code of these third-party open source libraries and provide it for us Set the corresponding system dependencies and compilation parameters for the project.

The principle of CocoaPods

The principle of CocoaPods is to put all dependent libraries in another project called Pods, and then let the main project depend on the Pods project, thus moving the source code management work from the main project to the Pods project.

Third-party libraries will be compiled into .a static libraries or .framwork dynamic link libraries for our real projects.

CocoaPods will combine all third-party libraries into a project named Pods in the form of targets, which will be placed in the newly generated Pods directory. The entire third-party library project will generate a static library named libPods.a for our project to use.

For resource files, CocoaPods provides a bash script named Pods-resources.sh, which will be executed every time the project is compiled, copying various resource files of third-party libraries to the target directory.

The original project settings have been changed. At this time, if we directly open the original project file to compile, an error will be reported. The Pods project where our project and third-party library are located will be organized and managed in the form of a newly generated workspace, which is convenient for us to intuitively manage the project and third-party library.

CocoaPods uses a file named Pods.xcconfig to set all dependencies and parameters at compile time

CocoaPods installation steps

Macos catalina install cocoa pods reviewsCocoapods

Ruby environment

1. Set up ruby ​​source

The ruby ​​environment that comes with the Mac system will be installed

Macos Catalina Install Cocoapods

1.1, check the ruby ​​source of your computer

ruby -v

Legend has it that the minimum version of ruby ​​supported by CocoaPods is 2.2.2. If your computer version is lower than this version, you can upgrade ruby. The above shows that my computer version does not need to be upgraded. You can ignore the following upgrade operation

sudo gem update --system

1.2 Replace ruby ​​mirror

Ruby's default original address is a foreign network address. Use the following command to view the current mirror
gem sources -l

Remove current mirror
gem sources --remove https://rubygems.org/

Add domestic ruby ​​mirror
gem sources -a https://gems.ruby-china.com/

Macos Catalina Install Cocoapods

Check the current mirror again and find that it has been replaced successfully

CocoaPods installation

Before Mac OS X 10.11
sudo gem install cocoapods

After Mac OS X 10.11
sudo gem install -n /usr/local/bin cocoapods

Macos catalina install cocoa pods free

Since the system of this machine is 10.15, choose the latter command input
sudo gem install -n /usr/local/bin cocoapods

2.2, check whether the installation is successful

pod search AFNetworking

I actually looked at this blog configuration at the beginning, but at this step I found that there seems to be a problem

Opened the website https://git.coding.net/CocoaPods/Specs.git
found this look
But the principle is

The Podspec files of all projects are hosted at https://github.com/CocoaPods/Specs. When pod setup is executed for the first time, CocoaPods will update these podspec index files to the local ~/.cocoapods/ directory. This index file is relatively large, about 80M.
And I guess the reason for this is to clone the code of this repository
CocoaPods/Specs
https://github.com/CocoaPods/Specs.git
But the clone code from git is quite full, so it is put on coding, but this warehouse is out of date or private.
So I cloned a warehouse on Code Cloud

After changing the code link, it succeeded and the speed flew up

To get the latest features and maintain the security, stability, compatibility, and performance of your Mac, it's important to keep your software up to date. Apple recommends that you always use the latest macOS that is compatible with your Mac.

Learn how to upgrade to macOS Big Sur, the latest version of macOS.

Check compatibility

The version of macOS that came with your Mac is the earliest version it can use. For example, if your Mac came with macOS Big Sur, it will not accept installation of macOS Catalina or earlier.

If a macOS can't be used on your Mac, the App Store or installer will let you know. For example, it might say that it's not compatible with this device or is too old to be opened on this version of macOS. To confirm compatibility before downloading, check the minimum hardware requirements:

Macos Catalina Install Cocoa Pods Reviews

  • macOS Catalina 10.15 hardware requirements
  • macOS Mojave 10.14 hardware requirements
  • macOS High Sierra 10.13 hardware requirements
  • macOS Sierra 10.12 hardware requirements
  • OS X El Capitan 10.11 hardware requirements
  • OS X Yosemite 10.10 hardware requirements

Download macOS using Safari on your Mac

Safari uses these links to find the old installers in the App Store. After downloading from the App Store, the installer opens automatically.

  • macOS Catalina 10.15 can upgrade Mojave, High Sierra, Sierra, El Capitan, Yosemite, Mavericks
  • macOS Mojave 10.14 can upgrade High Sierra, Sierra, El Capitan, Yosemite, Mavericks, Mountain Lion
  • macOS High Sierra 10.13 can upgrade Sierra, El Capitan, Yosemite, Mavericks, Mountain Lion

Macos Catalina Install Cocoa Pods For Sale

Safari downloads the following older installers as a disk image named InstallOS.dmg or InstallMacOSX.dmg. Open the disk image, then open the .pkg installer inside the disk image. It installs an app named Install [Version Name]. Open that app from your Applications folder to begin installing the operating system.

Macos Catalina Install Cocoa Pods Online

  • macOS Sierra 10.12 can upgrade El Capitan, Yosemite, Mavericks, Mountain Lion, or Lion
  • OS X El Capitan 10.11 can upgrade Yosemite, Mavericks, Mountain Lion, Lion, or Snow Leopard
  • OS X Yosemite 10.10can upgrade Mavericks, Mountain Lion, Lion, or Snow Leopard