diff --git a/template/README.md b/template/README.md index 3e2c3f8..478d278 100644 --- a/template/README.md +++ b/template/README.md @@ -34,30 +34,46 @@ yarn android ### iOS -For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps). +New apps use Swift Package Manager (SPM) for iOS dependencies. `init` sets this up for you, so you do not need CocoaPods or `pod install`. -The first time you create a new project, run the Ruby bundler to install CocoaPods itself: +```sh +# Using npm +npm run ios + +# OR using Yarn +yarn ios +``` + +When you add or remove a native library, the next iOS build picks up the change. To refresh the Swift Package Manager setup by hand, run: ```sh -bundle install +npx react-native spm update ``` -Then, and every time you update your native dependencies, run: +If `init` printed a warning that the Swift Package Manager setup failed, run this command in the project folder, then try again: ```sh -bundle exec pod install +npx react-native spm add --deintegrate ``` -For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html). +#### Using CocoaPods instead + +To create a new app with CocoaPods, add `--skip-spm` to the `init` command: ```sh -# Using npm -npm run ios +npx @react-native-community/cli@latest init MyApp --skip-spm +``` -# OR using Yarn -yarn ios +To switch an existing app from Swift Package Manager to CocoaPods, run: + +```sh +npx react-native spm deinit +bundle install +cd ios && bundle exec pod install ``` +With CocoaPods, run `bundle exec pod install` again each time you update your native dependencies. For more information, see the [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html). + If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device. This is one way to run your app — you can also build it directly from Android Studio or Xcode.