The ADB server port is changed to 10001, and appium cannot connect to the device

After modifying the ADB server port to 10001, enter ADB devices – L in CMD to successfully detect the device:

Open appium and run the script. The appium running log shows that the device cannot be connected and has been killing the port number 5037 ADB server. The error information is as follows:

I changed the port number of the ADB server to 10001. Why do I still kill 5037?

Seeing this error, when I first thought about it, the environment variable of the modified port was not configured to appium. Click the edit configurations button of appium, and I found that there were no new buttons, but only the default environment variable:

I searched a lot of information on the Internet and found no solution. Finally, I found a solution in an appium Chinese user guide,   Put the guide link here: appium Chinese User Guide – Jianshu (Jianshu. Com)

Modify the running script and add ‘adbport’: ‘10001’ to desired_ In caps Dictionary:

Restart appium, run the script again, connect the device successfully, and solve the problem!

PS: when using appium, you can familiarize yourself with the above instructions and have a general understanding of appium; Then, when running, you should pay attention to the running log. Many problems can be located step by step through the error reporting of the log

Read More: