Joseph Palmezano
Joseph Palmezano

Reputation: 1665

Running Expo/React Native in Android Device

I have an React Native app developed with Expo, while scanning the QR code works perfectly, when i try to run the app in a connected usb debug succesfully enabled android device with expo start --localhost --android it doesn't launch the app in the device, although it appears everything is ok:

Successfully ran adb reverse. Localhost URLs should work on the connected Android device.

Thanks it advance.

Upvotes: 9

Views: 38602

Answers (3)

roshnet
roshnet

Reputation: 2073

Other answers completely miss what the OP wants.

To anyone who comes across a similar issue -

  • Try manually starting your adb server before starting Expo.

    $ adb start-server

  • Sounds obvious, but make sure USB debugging is enabled. However, on the very first run, your phone will ask to allow access from your computer. Set this to always allow access from your computer.

  • Open the Expo app (update if possible). On running the command $ expo start --localhost --android, you should see your app launch on your device.


PS: This method is good for users like me who are paranoid about their phone's battery use. Connecting via a USB is less demanding on the phone & battery, as compared to using the wifi.

Upvotes: 18

Alexis Chupin
Alexis Chupin

Reputation: 21

So

1.

Quit all terminal

2.

Check if your device is connected to the same WiFi as your computer

3.

run npm start from the root of your directory's app

4.

Go to expo app on your phone and launch your app

Upvotes: -4

Alexis Chupin
Alexis Chupin

Reputation: 21

Are you working with expo managed workflow or bare workflow ?

In the both cases you need to check if you are connected on the same network with your device and your computer.

Sometimes just quit everything and relaunch the project after turn off/on your Wi-Fi works.

To launch your app you just need expo start or npm start, nothing else, if you're working with managed workflow.

Upvotes: 1

Related Questions