Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run React Native app on Android Phone

Tags:

I am building React Native app.

It is working well when I launch the app in terminal on Mac using "react-native run-android".

But when I got the apk file and installed it on another android device manually, it does not work.

It looks like this.

Crash on Huawei P8 lite

like image 751
William G. Avatar asked Apr 13 '16 21:04

William G.


People also ask

Can React Native be used for Android?

React Native combines the best parts of native development with React, a best-in-class JavaScript library for building user interfaces. Use a little—or a lot. You can use React Native today in your existing Android and iOS projects or you can create a whole new app from scratch.

How do I run react on my phone?

Simply pull up your device's browser and type in the IPv4 Address you copied down earlier followed by a colon and then the port number. The format should look something like the following: 555.55. 55.555:1234 once you hit enter, you should see your React App live on your mobile device!


1 Answers

If you are connected via cable, do the following:

1. Goto > Settings > About Device

2. Then Software Info

3. Then > Build Number

4. Now Tap (Click) multiple times on Build Number to Enable Developer Options

5. Here you go not the Developer Options will be visible in your Settings

6. Now Go inside the Developer Options and Enable USB Debugging Mode.

7. Open your terminal

On Windows open Android SDK Manger > Platform Tools

Type:

$ adb devices 

This will show you the devices and simulator/virtual-devices that you have on you computer.

8. Forward requests from your device

Type:

$ adb reverse tcp:8081 tcp:8081 

9. Run it

Type:

$ npm run android 

The app should appear on your device

like image 118
abranhe Avatar answered Oct 18 '22 09:10

abranhe