Home/Without a Mac/How do I debug React Native iOS on the simulator and a real iPhone without a Mac?

How do I debug React Native iOS on the simulator and a real iPhone without a Mac?

Updated · airankrush

The short answer

Simulator debugging works fully on a remote Mac, because the Metro bundler and the simulator are on the same machine. Real-device debugging does not: the official React Native flow connects the iPhone to the Mac over USB and requires the phone and the computer to be on the same Wi-Fi to reach the development server. A remote machine meets neither condition.

Which steps require macOS

Only possible on macOS

  • Compiling and launching the iOS app on the simulator: behind npm run ios is an Xcode build.
  • Installing a debug build on a real device: the official running on device documentation requires a USB connection and a Team selected in Xcode for both the main target and the Tests target.

No Mac needed

  • The Metro bundler itself is a Node program and runs on any system. JavaScript logic, components and state problems can all be debugged on Android.

Why a remote Mac cannot reach your phone

Besides the missing cable there is another layer: a debug build has the development machine's local network address written into it, and the first item in the official troubleshooting advice is to confirm that the computer and the phone are on the same Wi-Fi. The remote Mac and your phone are not on the same network. Customers may not change the machine's network configuration, and we do not recommend installing tools that expose ports to the outside to get around this.

How to do it on a remote Mac

  1. Launch on the simulator

    In the project's top-level directory:

    npm run ios

    It compiles the native project, starts the simulator and brings up Metro. The first compile takes the longest; after that, changing only JavaScript does not require recompiling the native part.

  2. Pick a device model or OS version

    As written in the official documentation:

    npm run ios -- --simulator="iPhone SE (3rd generation)"
    npm run ios -- --udid="<device UDID>"

    List available devices and UDIDs with xcrun simctl list devices. The model name must match the list exactly, and what the list contains depends on the Xcode and simulator runtimes you installed.

  3. Open the developer menu and DevTools

    In the simulator press Ctrl + Cmd + Z, or use the menu Device → Shake, to bring up the developer menu. React Native DevTools opens in two ways: choose Open DevTools in the developer menu, or press j in the terminal running Metro. When working through a remote desktop, shortcuts involving Cmd may be captured by your local system; use the simulator's menu items instead.

  4. Reading errors: LogBox and native logs

    JavaScript errors and warnings are shown by the in-app LogBox; a fatal error brings up a full-screen notice with the location. LogBox cannot see native crashes. For those, open the .xcworkspace in Xcode, run the same simulator from Xcode, and read the native stack trace in the console.

  5. Real-device checks: a Release build through TestFlight

    Archive and upload following the steps on our React Native build page, add yourself to TestFlight internal testing, and install on the iPhone you have at hand. Note what the official documentation says: the developer menu, LogBox and DevTools are all disabled in Release builds, so problems on a real device can only be located through log reporting and crash collection you added in advance.

  6. Narrowing down problems that appear only on a real device

    First run the Release configuration in the simulator with npm run ios -- --mode="Release". Many "only on a real device" problems are really differences between Debug and Release (minification, environment variables, assets missing from the offline bundle) and reproduce in the simulator's Release mode. Once that group is ruled out, what remains is what truly depends on hardware.

FAQ

Can Metro run on my own Windows PC while the app runs in the simulator on the remote Mac?

Not recommended. The two machines are not on the same local network, so the app in the simulator cannot reach the bundler on your computer. Put both Metro and the simulator on the remote Mac, and sync code with Git or simply edit it on the remote Mac.

A red screen says it cannot connect to the development server. What now?

In the simulator case, usually Metro is not running or the port is still held by a previous process. Close the old terminal window, run npm start again, and reload in the simulator.

Can Expo Go replace real-device debugging?

The official React Native documentation does list Expo Go as a way to develop on an iOS device without a Mac, but it only applies to projects with no custom native code. A native project that already has an ios/ directory cannot take that route.

Is renting a remote Mac mainly for debugging worth it?

If your problems are mostly in UI and JavaScript logic, the simulator plus TestFlight is enough. If you need breakpoints on a real device every day, a Mac on your desk suits you better. Pricing and availability are on the plans page.

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

Back to home · All no-Mac guides