DEV Community

ochieng seth
ochieng seth

Posted on

2 2

How to run a react-native app on a real device using terminal

👋🏿Jambo folks,
Constantly opening Xcode to build your app on a real device is a pain, open your terminal and lets' dive right in.

Step 1

  • For whatever weird reason you don't have it yet, install homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 2

  • install ios-deploy

brew install ios-deploy

now what you have been waiting for 😛

  • connect your device via usb (of-course) then in terminal,

ios-deploy -c

The result will be

Found 7875****************** (D20AP, <iphone version>, iphoneos, arm64, 1543) a.k.a. '<device name>' connected through USB.

  • copy the 7875******************
  • now lets build the app with

npx react-native run-ios --udid 7875******************

Hope it helps😊

Top comments (1)

Collapse
 
coucoseth profile image
ochieng seth

new method is npx react-native run-ios --device="[DEVICE_NAME]"

Sentry growth stunted Image

If you are wasting time trying to track down the cause of a crash, it’s time for a better solution. Get your crash rates to zero (or close to zero as possible) with less time and effort.

Try Sentry for more visibility into crashes, better workflow tools, and customizable alerts and reporting.

Switch Tools