2016.9.11 Android Studio will also have this problem, the solution is just like the error message different ADB connection Error:an existing connection is forcibly closed by the R Emote Host--------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------
When the phone is connected to the computer port to run the ADB program debugging, the following situation occurs:
Analysis: The reason for the error is that the ADB's ports are occupied by the process of other programs, so what you have to do is find and kill the process.
Workaround:
1. Execute the ADB nodaemon server in CMD to see what the ADB's port number is, typically 5037 (why? The port number used by the software is fixed), as shown below
2.
Re-execute Netstat-ano | Findstr "5037", you will see a similar scenario as follows:
Here's a little explanation, the left-to-right meaning of the display is the connection type (TCP), the local address and port, the external address and port, the connection state, and the process's PID number. There are two processes occupying 5037 ports, one of which occupies a local 5037 port, and the other occupies an external 5037 port, which is, of course, the local PID 240 port.
3.ctrl+alt+del called the Service Manager. Click on the process and now you are looking for the PID 240 process. Sometimes you may find that the Task Manager does not have process PID information displayed, so just click on the Task Manager's view--> Select columns, the following figure, and then the PID check can be selected. This time the PID of the current process is viewed again, and the process of PID 240 is killed. Then run the ADB command and go smoothly.