Joke Collection Website - Mood Talk - How to debug a React Native for Android APP happily?

How to debug a React Native for Android APP happily?

There are two devices for debugging Android applications:

Simulator: the third-party Android SDK or Genymotion's own emulator.

The real machine here focuses on how to debug with the real machine. If the simulator is only used for demonstration and has no significance for actual development, I won't go into details here. Necessary for real machine debugging:?

First, make sure that your computer and mobile device are in the same Wi-Fi environment. ?

Secondly, you need to turn on USB debugging to install your APP on your device. Make sure you have turned on the USB debugging switch of the device!

To ensure that your device is successfully connected, you can enter adb device for verification:?

Seeing the device in the right column means that your device is connected correctly. Please note that you should only connect one device.

Because if you connect multiple devices (including simulators), some of your subsequent operations may fail. Unplug unnecessary devices or turn off the emulator to ensure that only one output of the adb device is connected.

Now we can run react-native run-android to install and start our application on the device.

After this command is executed, it is actually to set up a node server locally and put your android.

Project compiles, packages and uploads it to your mobile phone. Then, when the js file is changed or in debugging mode, manually select reload.

Js will automatically update the binding file to achieve the debugging effect of displaying it immediately after changing the js file.

What the hell is this "red screen"? Don't worry, it's normal. We need to connect to the development server. The following steps will solve this problem.