Home/Glossary/What is CocoaPods, and do I still need to install it?

What is CocoaPods, and do I still need to install it?

Updated · airankrush

Term · CocoaPods

CocoaPods is a tool for managing third-party libraries in Xcode projects, written in Ruby. You declare the libraries you need in a Podfile in the project folder and run pod install; it downloads those libraries and generates a workspace file that links them with your project, and from then on you open the workspace rather than the original project to build. It used to be the de facto standard in the iOS ecosystem, and the iOS side of frameworks such as Flutter and React Native has long depended on it. The project has announced a plan to move its central specs repository to read-only in stages, and new projects mostly use Apple's own Swift Package Manager instead; for the timeline follow the official CocoaPods blog.

How it relates to renting a remote Mac

CocoaPods generates and modifies Xcode projects, so in practice it is used on macOS. When you develop a cross-platform app on Windows, the Android side of the framework does not use it, which is why many people first see it only once they are on a Mac.

On a rented Mac:

  • The customer account is an admin account, so you can install it yourself. Installing with Homebrew is usually less trouble than modifying the Ruby that comes with the system; for specifics follow the official CocoaPods guide.
  • The first pod install has to download the index and the source of each library. How long it takes depends on the number of dependencies and the state of the line at the time. It is a one-time cost; after that there is a local cache.
  • If a download fails, retry first or try at a different time of day. Do not change this machine's network configuration to speed things up.
  • Commit Podfile.lock to your code repository so that the same set of versions is installed on any Mac, and the environment can be reproduced when you change machines or end a rental and rent again later.

If the framework version you use has already moved to Swift Package Manager for iOS dependencies, you may not need CocoaPods at all; follow the framework's official documentation. For the read-only plan see the official CocoaPods blog.

FAQ

After the central repository goes read-only, will existing projects still build?

According to the project's announcement, read-only means no new libraries or new versions are accepted; existing ones can still be downloaded and existing builds keep working. In the long run dependencies will stop receiving updates, and migration plans depend on each library's author.

Why do I have to open the workspace file after pod install?

The third-party libraries are added to the workspace as a separate project. If you open only the original project file, Xcode cannot find those libraries and reports missing modules.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · Glossary