Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading