Home/Without a Mac/How do I build an .ipa for a React Native (non-Expo) project without a Mac?

How do I build an .ipa for a React Native (non-Expo) project without a Mac?

Updated · airankrush

The short answer

For a React Native project with native code, installing iOS dependencies, compiling and archiving all have to be done on macOS; the official environment documentation lists the iOS target on Windows and Linux as unsupported. JavaScript business code can still be written on your usual computer. If the project uses Expo the situation is different: cloud builds work without a Mac of your own.

Which steps require macOS

Steps that need macOS

  • Installing CocoaPods dependencies under ios/, and opening the .xcworkspace in Xcode to compile.
  • Archiving and exporting: the official publishing documentation does all of it inside Xcode and gives no single command that outputs an .ipa.
  • The Bundle React Native code and images phase of the build: an Xcode build script calls Node to bundle the JavaScript into an offline bundle.

What you can finish on Windows / Linux first

  • All JavaScript / TypeScript code and debugging of the Android version.
  • Upgrading package.json dependencies and the lockfile. Note that after a native module is upgraded, the iOS side has to go back to the Mac to reinstall Pods.

The official React Native environment documentation says it plainly: building a project with native iOS code requires a Mac. The other route it points people without a Mac to is Expo.

How to do it on a remote Mac

  1. Install Node and Watchman

    Your account on the remote Mac is an admin account, so you can install Homebrew. The commands in the official documentation are:

    brew install node
    brew install watchman

    The documentation sets a minimum Node version; take the exact number from the official page. Try to keep the same major Node version as your everyday development machine to reduce lockfile differences.

  2. Install Xcode, the command-line tools and CocoaPods

    Install Xcode from the App Store. Open it, go to Xcode Settings → Locations, and select the latest version in the Command Line Tools dropdown; skipping this leaves the command line unable to find the compiler. CocoaPods is a Ruby gem. The official documentation suggests installing it with the Ruby that ships with macOS; see the CocoaPods getting started guide for the exact command.

  3. Pull the code and install dependencies

    Clone the repository on the remote Mac, install the JavaScript dependencies first, then go into ios/ and run pod install (if the template project includes a Gemfile, follow the template README). From then on always open the .xcworkspace, not the .xcodeproj.

  4. Fix Xcode not finding Node

    This pitfall is specific to React Native: Xcode's build scripts run in their own environment and cannot read the PATH from your terminal. The .xcode.env file in the template sets the path to Node through NODE_BINARY. If you use nvm, the official documentation suggests putting the nvm initialisation lines in ~/.zshenv so Xcode can find it too.

  5. Switch the run configuration to Release

    Following the official publishing documentation: Product → Scheme → Edit Scheme, select Run on the left, and change Build Configuration to Release. A Release build turns off the developer menu and bundles the JavaScript into the app, so it does not need a development machine attached after installation. To check Release behaviour on the simulator first, you can use:

    npm run ios -- --mode="Release"
  6. Archive and export

    In Xcode set the run destination to Any iOS Device (arm64) and click Product → Archive. When archiving finishes, in the window that appears click Distribute App → App Store Connect → Upload, choosing automatic or manual signing as needed. The uploaded build then appears under TestFlight in App Store Connect. If you only want the .ipa file without uploading, pick the export-type option in the same distribution flow; its name depends on the current Xcode.

FAQ

Why is the Archive button greyed out?

The run destination is set to a simulator. Archive only becomes available after you switch the destination to Any iOS Device (arm64).

The build fails at "Bundle React Native code and images". Why?

Mostly because Xcode could not find Node, or the JavaScript itself failed to bundle. Check NODE_BINARY in .xcode.env first, then start the bundler on its own in a terminal to see whether there are syntax or dependency errors.

Can I build purely from the command line, without the Xcode interface?

The official React Native documentation gives no such command. A common approach is to script archiving and exporting with xcodebuild or fastlane; take the parameters from their respective official documentation. We suggest getting it working once in the graphical interface before scripting it.

Is it worth migrating to Expo just for this step?

It depends on the project. Expo's cloud builds work without your own Mac, but a project that already has a lot of custom native code is costly to migrate. If you only package occasionally, either renting a remote Mac or using a cloud build service will do; the comparison is in remote Mac or cloud build: which to choose.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All no-Mac guides