Home > database >  React Native: How can I create a binary and run it directly on iPhone?
React Native: How can I create a binary and run it directly on iPhone?

Time:02-03

I have a bug in my React Native app that occurs on TestFlight builds but not when I run it from my computer. Is there a way to create a binary like the one that I'd push to the App Store, and then run it directly on my device so that I don't have to push it to TestFlight every time?

CodePudding user response:

You can create a "Release" build of your React Native app and run it on your phone by changing the scheme of the "Run" action.

First, click on your target in the Xcode header (left side of the attached image).

enter image description here

Scroll down and choose "Edit scheme"

Next, choose the "Run" scheme.

enter image description here

Then, change "Build configuration" to "Release".

Connect your phone, choose the phone as a build target and Run from Xcode. The version that will be run will be the same as the version that gets created when you archive and send to TestFlight.

enter image description here

CodePudding user response:

I think the closet thing you can do is

1) Connect your phone with a usb to your computer

2) You have to press trust device

3) Open up the file ios/__YOUR_PROJECT_NAME_.xcworkspace

4) On the top you will something like this below. Click where it says "iPhone 12 Pro Max" and choose your phone out of the options enter image description here

5) Finally press the arrow to run

  •  Tags:  
  • Related