1. Please make sure that the mobile device and the computer are in the same local area network, and the developer mode of the mobile device is turned on, and the usb debugging is turned on in the developer option of the mobile device, and remote debugging is turned on. And requires root privileges.
Open these two settings in the simulator, please see the content of the red box in the figure below, you need to open these two settings
2. It is necessary to configure the adb environment variable of the computer.
By opening the setting page of android studio, as shown in the figure below, find the path of the sdk. This path will be used later, which is the content of the red box.
Then we go to this path C in the file management: \Users\QHC\AppData\Local\Android\Sdk\platform-tools, which is the content in the picture, please see the picture, the adb program in the red box is the command we need to use in the cmd command line window in the future, put adb Copy the file path where it is located
3. Open the environment variable
as shown in the figure below, select the content in the red box, click Edit
and then it will appear like this, select New,
this is my newly created path, you can paste the adb path you just copied into it up. Then make sure all the way.
4. Then open the cmd command line window and directly enter adb connect 192.168.43.149:5555, and the following figure will be displayed, indicating that the connection is successful. At this time, you can debug the app program in android studio. If you need to disconnect the device, enter adb disconnect
5. The Android adb connection cmd reports an error cannot connect to 192.168.137.137:5555: The connection attempt failed because the connected party did not reply correctly after a period of time or the connected host did not respond. (10060). Please see this article I wrote.
https://blog.csdn.net/qq_36570506/article/details/131256947