cli icon indicating copy to clipboard operation
cli copied to clipboard

use pod installed by bundler if possible

Open buschco opened this issue 6 months ago • 0 comments

Summary

see https://github.com/react-native-community/cli/issues/2668 and https://github.com/react-native-community/cli/issues/2663 (should fix both).

This change ensures that local installed cocoapods (bundle exec pod) is used before system installed pod.

Test Plan

A: Bundled Version:

  1. make sure no cocoapods is not installed globally: gem uninstall cocoapods
  2. npx @react-native-community/cli@latest init MyApp
  3. press n for cocoa pods question
  4. cd MyApp
  5. bundle install

Now bundle exec pod --version has an 0 exit code.

npx react-native run-ios --force-pods will not fail nor install cocoapods globally (pod will have exit code > 0)

B: Global Version (someone could argue this should never be supported anyway):

  1. make sure cocoapods is installed globally: gem install cocoapods
  2. npx @react-native-community/cli@latest init MyApp
  3. press n for cocoa pods question
  4. cd MyApp
  5. remove cocoapods from Gemfile
  6. bundle install

Now bundle exec pod --version has an non 0 exit code.

npx react-native run-ios --force-pods will not fail and install cocoapods globally (pod will have non 0 exit code)

Checklist

  • [x] Documentation is up to date.
  • [x] Follows commit message convention described in CONTRIBUTING.md.
  • [x] For functional changes, my test plan has linked these CLI changes into a local react-native checkout (instructions).

buschco avatar Jun 03 '25 13:06 buschco