Use the simulator debugging the react - native steps (android) 1. Build in CMD interface react - native environment: https://reactnative.cn/docs/0.51/getting-started.html for reference#contentNPM install -g yarn react-native- CLI Install the yarn command tool and react-native command tool. Yarn is an alternative tool provided by Facebook to speed up the download of node modules. React Native's command-line tools perform tasks such as creating, initializing, updating projects, and running the Packager service. (2) yarn configsetRegistry https://registry.npm.taobao.org - global yarn configsetDisturl https://npm.taobao.org/dist - global yarn tool set up the mirror source 2. AwesomeProject AwesomeProject is a custom project name. Note: Enter this command to create a project in the app folder as shown in the following figure. (2)cdAwesomeProject enters the project file and needs to connect to the device before running it. 3. Install the emulator: (1) Download the Nighthian emulator or Pleasure Emulator, or use Genymotion or Android-Studio (these two will not be described) (2) Connect the emulator: Adb Connect 127.0.0.1:21503 adb Connect 127.0.0.1:21503 adb Connect 127.0.0.1:21503 adb Connect 127.0.0.1:21503 adb Connect 127.0.0.1:21503 (3) Check whether the connection is successful adb Devices appear the following things indicate that the mobile phone connection is successful, then you can start the project 4. Start the React-Native project React-Native Run-Android 5. Solution: Shake the phone, the emulator toolbar on the right has a shake function, pop up the menu, choose Dev Settings --> Debug Server host&PortforDevice, enter the IP address of your computer in the pop-up dialog box: 8081. The IP address of your computer can be viewed by entering ipconfig in CMD. IPv4 address............ : 192.168.2.777 (this) click OK, reload! 6. Restart the device. Run the react-native run-Android command in CMD to restart the project. Now that you're done, you can compile in your project's app.js file. (1) Open developer mode, set ------ "about mobile ------" version number (multiple times) (2) Enter developer option ---- "open USB debugging (3) If your data cable is connected to the computer input: Adb Reverse TCP :8081 TCP :8081 (4) If you do not use data cable connection, first make sure that your phone and computer are in the same LAN, then shake the phone, popup menu, Select Dev Settings --> Debug Server host&PortforDevice, in the dialog box that pops up, type in your COMPUTER's IP: 8081, hit OK, reload! (5) A white screen may be encountered when running on the real machine. Please enable the suspension window permission in setting ----Copy the code