adb server is out of date. killing [How to Solve]

Originally, I wanted to run the monkey test. You can use the ADB command to prompt: ADB server is out of date. Killing

the reason for this problem is that the port 5037 used by ADB is occupied . Next, let’s talk about how to find out which program occupies this port. By the way, let’s take a look at some Linux like process operations in CMD

1. Error message: 

C:\Users\admin> adb shell monkey -help
adb server is out of date. killing…
ADB server didn’t ACK
* failed to start daemon *
error: unknown host service

2. Reason: 

The port (5037) of the ADB is occupied. For this 5037 port, please refer to another article in this blog:

http://blog.csdn.net/liranke/article/details/4999210

In this article, the principle of ADB and its source code analysis are explained in detail

3. Solutions:

(1) Check the port number of the ADB: ADB nodeamon server

C:\Users\admin> adb nodaemon server
cannot bind ‘tcp:5037’

Tip: unable to bind port 5037

(2) Find the process occupied by port 5037: netstat – ano | findstr “5037”

C:\Users\admin> netstat -ano | findstr “5037”
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 10760
TCP 127.0.0.1:5037 127.0.0.1:53437 TIME_ WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:53440 TIME_ WAIT 0
TCP 127.0.0.1:5037 127.0.0.1:53445 TIME_ WAIT 0

(3) Find the application corresponding to the process occupying the port: tasklist | findstr “10760”

C:\Users\admin> tasklist | findstr “10760”
PPAdbServer.exe 10760 Console 1 6,044 K

(4) There are two ways to kill the process:

Method 1: through the task manager, find ppadbserver.exe in the process and end the process. This method is simple and efficient

If you want to learn more about the CMD command, you can use the following method

Method 2: taskkill/F/PID 10760

C:\Users\admin> taskkill /f /pid 10760

Success: process with PID 10760 terminated

4. Restart ADB

C:\Users\admin> adb shell monkey -help
usage: monkey [-p ALLOWED_ PACKAGE [-p ALLOWED_ PACKAGE] …]
[-c MAIN_ CATEGORY [-c MAIN_ CATEGORY] …]
[–ignore-crashes] [–ignore-timeouts]
[–ignore-security-exceptions]
[–monitor-native-crashes] [–ignore-native-crashes]
[–kill-process-after-error] [–hprof]

Similar Posts: