-
Notifications
You must be signed in to change notification settings - Fork 926
Description
Describe the Feature
As React Native transitions from CocoaPods to Swift Package Manager (SPM) for iOS dependency management, the community is moving away from direct pod install
usage. While developers currently rely on CocoaPods for dependency management, the upcoming migration to SPM will require a new approach for projects that don't use the CLI's build-ios
command (e.g., those with custom build scripts, CI/CD pipelines, or manual Xcode builds).
This feature request proposes adding a new CLI command that prepares iOS dependencies in a technology-agnostic manner, serving as the modern replacement for direct pod install
usage while supporting the ecosystem's evolution toward SPM.
Possible Implementations
Add a new CLI command with a name like prepare-ios-dependencies
or install-ios-deps
that reuses the existing CocoaPods/SPM installation logic from the current run-ios
and build-ios
commands:
- Reuse Existing Logic: Extract and reuse the dependency resolution logic already implemented in
run-ios
andbuild-ios
commands - Technology Detection: Leverage the same detection mechanisms used by existing commands to identify CocoaPods vs SPM projects
- Dependency Resolution: Execute the same dependency installation process without the build phase:
- For CocoaPods projects: runs the same
pod install
logic asrun-ios
/build-ios
- For SPM projects: performs the same Swift package resolution as existing commands
- For hybrid setups: handles both dependency managers using existing patterns
- For CocoaPods projects: runs the same
- CI/CD Friendly: Provides options for non-interactive mode and clear exit codes for automation
- Consistency: Ensures identical dependency resolution behavior across all CLI commands
Example usage:
npx react-native prepare-ios-dependencies
npx react-native prepare-ios-dependencies --verbose
npx react-native prepare-ios-dependencies --ci
This command would be particularly valuable for:
- Custom build processes that don't use
build-ios
- CI/CD pipelines requiring explicit dependency preparation steps
- Developers who build through Xcode directly
- Projects with complex dependency management needs
Related Issues
- Original discussion: Re: DEPRECATION NOTICE - Calling
pod install
directly is deprecated in React Native discussions-and-proposals#924 - Specific request comment: Re: DEPRECATION NOTICE - Calling
pod install
directly is deprecated in React Native discussions-and-proposals#924 (comment) - Maintainer guidance: Re: DEPRECATION NOTICE - Calling
pod install
directly is deprecated in React Native discussions-and-proposals#924 (comment)