What is pod-install?
The pod-install npm package is a tool designed to streamline the process of installing CocoaPods dependencies for React Native projects. It automates the execution of 'pod install' in the iOS directory of a React Native project, ensuring that all necessary iOS dependencies are correctly installed and up-to-date.
What are pod-install's main functionalities?
Automatic CocoaPods Installation
This feature allows users to automatically run 'pod install' in the iOS directory of a React Native project. It simplifies the process of managing iOS dependencies by ensuring that all necessary CocoaPods are installed without manually navigating to the iOS directory and running the command.
npx pod-install
Custom iOS Directory
This feature provides the flexibility to specify a custom path to the iOS directory if it is not located in the default location. This is useful for projects with non-standard directory structures.
npx pod-install --ios-directory=custom/path/to/ios
Verbose Logging
Enables verbose logging to provide detailed output of the pod installation process. This is helpful for debugging and understanding the steps being taken during the installation.
npx pod-install --verbose
Other packages similar to pod-install
cocoapods
CocoaPods is the dependency manager for Swift and Objective-C Cocoa projects. It is the underlying tool that pod-install automates. While CocoaPods is a more general tool for managing iOS dependencies, pod-install is specifically tailored for React Native projects, providing a more streamlined and automated experience.
react-native-cli
The React Native CLI is a command-line tool for managing React Native projects. It includes commands for running 'pod install' as part of its iOS project setup. While it offers broader functionality for React Native project management, pod-install focuses specifically on the CocoaPods installation process, providing additional options like custom directory paths and verbose logging.
👋 Welcome to
pod-install
A fast, zero-dependency package for cutting down on common issues developers have when running pod install
.
🚀 Usage
npx pod-install
👋 Notice: This package is not limited to native React projects, you can use it with any iOS or Xcode project using CocoaPods (like Ionic, or Flutter).
🤔 Why?
All native packages (especially those installed with NPM) often need to explain the following:
- What is CocoaPods.
- What is gem.
- How to install CocoaPods.
cd
into the proper directory before running pod install
.- You may need run
pod repo update
to fix your project. - Why CocoaPods requires a darwin machine.
But now you can simply instruct users to run npx pod-install
.
This package will do the following:
- Check if the machine is darwin.
- If not then it'll quit with a helpful error message.
- Ensure CocoaPods CLI is installed on the machine.
- If not then it'll try to install CocoaPods CLI, first with gem, then with homebrew.
- Check if there is an Xcode project in the current directory
- If not then it'll try again in
ios/
than macos/
directories (if any exists).
- Run
pod install
- If
pod install
fails because the repo is out of date, then it'll run pod repo update
and try again.
⚙️ Options
For more information run npx pod-install --help
(or -h
)
Flag | Input | Description | Default |
---|
--non-interactive | [boolean] | Skip prompting to install CocoaPods with sudo | process.stdout.isTTY |
--quiet | [boolean] | Only print errors | false |
License
The Expo source code is made available under the MIT license. Some of the dependencies are licensed differently, with the BSD license, for example.