Introduction: Usually multi-terminal development of Android real machine debugging development, has always been wired to connect android real machine debugging, so always feel not very convenient, such as mobile phone data line interface sometimes broken contact or disconnect, so need to reinstall the application APK, is very inconvenient. So I went to understand the Android wireless real machine debugging

Environment configuration

MAC Multi-terminal Android environment configuration

Plug-in installation

ADB Interface for VSCode

steps

  1. The phone is connected to the computer by cable

Check whether the device is successfully connected [Note: Just show the device is connected]

adb devices
Copy the code

  1. Open thevscodeCommand panel and execute the following command
  • Open command Panelcmd + shift + p
  • Execute the following command
Disconnect from any devices
Copy the code

Execution Result:

Reset connected devices port
Copy the code

Enter port number 5555

Connect to device IP
Copy the code

Enter the mobile network IP address, press Enter, and then enter the port number 5555

  1. View the connected mobile device, and you can see that the device name isStep 2Enter the mobile networkip:prot
adb devices
Copy the code
  • According to the normalrnThe default startup port number is:8081
npm run start
Copy the code
  • Enter it on the websitelocalhost:8081You can see the following

  1. performStep 3After the command, you can unplug the data line. The following operation is basically the same as connecting the data line for real machine debugging steps
  • Start theandroidAt this time, the installation package will be requested to be installed on the mobile phone (just install the normal software. If the mobile phone does not confirm the installation after the installation, an error will be reported during startup).
npm run android
Copy the code

Indicates that the server is running and the PC is configured

  1. mobile-equippeddebug settingConnect the phone to this port of the computer to get the script (this step can be omitted if there is no error)
  • Shake the phone to open the developer menu screen

  • chooseSettings, click on theDebug server host & port for device, enter the computer’s wireless network IP and the port number used to start the service8081
192.168.0.2.8081
Copy the code

  • Shake the phone and clickReloadOr quit the application and re-enter itappRun successfully, log output invscodeOn the console of