Xcode Cloud React Native Setup

Xcode Cloud is a new CI platform from Apple. It will automatically build your app anytime you commit to certain branches. I've found that it's pretty good so far, although if it was a little faster and allowed you to cache dependencies, it would be perfect.
Setting it up for React Native applications is pretty easy. Unlike Github Actions, there is only one machine type. Thankfully it comes with Homebrew already installed, but that's it. So we must install cocoapods, and yarn, then we can actually install our dependencies.
Before we create an Xcode Cloud workflow, we need to setup our app.
Create a new file. It must be located here: ios/ci_scripts/
ci_post_clone.sh
#!/bin/sh
# Install CocoaPods and yarn using Homebrew.
brew install cocoapods
brew install yarn
# Install dependencies
yarn
pod install
Edit: Check the bottom section for an updated ci_post_clone after you read through the article.
Now, if you create a new Xcode cloud workflow, it will complete successfully.
At the time of writing…
Keep reading with a 7-day free trial
Subscribe to zach.codes to keep reading this post and get 7 days of free access to the full post archives.