​adb server is out of date. killing解决方法

时间:2023-03-09 08:05:28
​adb server is out of date.  killing解决方法

adb server is out of date.  killing完美解决

今天,久未出现的著名的“adb server is out of date.  killing”又发生了,在此,将解决方法记下,以便日后查看。

连接usb后重启adb-server:

adb kill-server

adb start-server

adb devices

1. 错误信息:

C:\Users\lizy>adb devices

adb devicesadb server is out of date.  killing...

ADB server didn't ACK* failed to start daemon *error: unknown host service

 

2. 原因:

adb的端口(5037)被占用了。至于这个5037端口,可以参考本博客另外 一篇文章:

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

在这个文章里,详细说明了adb的原理及其源码分析

 

3. 解决方法:

在cmd窗口:
C:\Users\lizy>adb nodaemon server
cannot bind 'tcp:5037'

C:\Users\lizy>netstat -ano | findstr "5037"
  TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       8516
  TCP    127.0.0.1:5037         127.0.0.1:59163        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:59164        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:59167        TIME_WAIT       0
  ......
C:\Users\lizy>tasklist | findstr "8516"
sjk_daemon
                       8516 Console                    1     3,071 K

哦,原来是sjk_daemon进程占了adb的端口。

C:\Users\lizy>tasklist

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
System Idle Process              0 Services                   0         24 K
System                           4 Services                   0      1,128 K
sjk_daemon                     963 Console                    1      3,071 K
tasklist.exe                  1260 Console                    1      5,856 K

将这个进程kill掉:
C:\Users\lizy>taskkill /f /pid 963

如果这个命令提示无权限,那么,可以去windows的“任务管理器”中“进程”那个窗口,找到这个进程,将它杀掉。

再运行adb devices,就没有问题了。
C:\Users\lizy>adb devices
4df7f482396a301d        device

运行adb shell命令出错怎么办

运行adb shell提示“adb server is out of date”怎么办呢?通常导致此类情况产生的重要原因是由于端口被占用所造成的。对应的解决方法如下。

​adb server is out of date.  killing解决方法

方法/步骤

  1. 1

    在使用ADB命令前,首先必须确保电脑安装了手机或平板电脑的驱动程序,可以从对应官方网站下载与手机类型相匹配的驱动,也可以通过刷机精灵来安装手机驱动 。

    ​adb server is out of date.  killing解决方法

  2. 2

    当运行“adb shell“命令出现“adb server is out of date,killing...”提示时,可以先执行“adb nodaemon server”来查看“adb server”端口的信息。如图所示:

    ​adb server is out of date.  killing解决方法

  3. 3

    待得到“ADB Server”端口信息后,执行“netstat -ano | findstr "5037"命令,其中“5037”为“ADB Server”端口号。

    ​adb server is out of date.  killing解决方法

  4. 4

    从返回的结果列表中找到“TCP”项右侧的数字,如图所示为“5240”。此序号即为当前占用“ADB Server”端口的进程号,我们需要中止此进程。

    ​adb server is out of date.  killing解决方法

  5. 5

    执行命令“tskill 5240"即可中止占用“ADB Server”端口的进程号。如图所示:

    ​adb server is out of date.  killing解决方法

  6. 6

    最后再次执行“ADB Shell”命令,就可以正常进入Shell管理操作模式啦。

    ​adb server is out of date.  killing解决方法

在cmd里面运行adb命令的时候提示:adb server is out of date.  killing...

出现这个原因从下面两个步骤进行:

1. 在任务管理器里面kill掉adb.ext进程。

2.
干掉豌豆夹进程(名字里面有wandoujia的)、干掉迅雷手机的进程(ThunderMobile.exe)、干掉360手机助手进程。总之,干掉一
切会连接手机的各种助手。我是在任务管理器里面找了好久才找到ThunderMobile.exe这个进程,干掉之后,再干掉adb.exe,就可以正常
运行adb命令了。

很多**手机助手都会劫持adb.exe进程,达到跟手机通讯的目的,对于Android开发者会造成很大的不便。而且你永远不知道哪个应用程序会偷偷的增加跟手机通讯的功能(比如蛋疼的ThunderMobile)。

2014.03.14(add)。发现一个更好的解决方案,见下文。

转载请注明出处:http://blog.csdn.net/xiaanming/article/details/9401981

ADB server didn't ACK
这个问题会困恼很多的新手朋友,我以前刚开始做Android的时候也遇到过这个问题,不过自己百度,google啥的,也不知道怎么就给解决了,看到群
里很多新手朋友都会问这个问题,说实话我也没有一个解决这个问题的终极方法(百试百灵的那种,哈哈),自己没遇到也没有认真的去对待他,今天,就是在今
天,我打开Eclipse连上手机,准备调试程序,出现如下的信息

[plain] view
plain
copy​adb server is out of date.  killing解决方法​adb server is out of date.  killing解决方法

  1. The connection to adb is down, and a severe error has occured.

  2. You must restart adb and Eclipse.

  3. Please ensure that adb is correctly located at 'D:\android-2.2-windows\platform-tools\adb.exe' and can be executed.

然后我就按照
他的要求来做,重启Eclipse和adb,然后确认adb的路径是否正确,然后当我再次运行程序的时候,依旧不行,之后我就开始百度了,有朋友说先在
DOS下运行adb kill-server(你必须在环境变量中配好你adb的路径或者进入到adb.exe的目录下),然后在adb
start-server,当我运行adb start-server的时候,DOS出现如下信息

[plain] view
plain
copy​adb server is out of date.  killing解决方法​adb server is out of date.  killing解决方法

  1. * daemon not running. starting it now *

  2. ADB server didn't ACK

  3. * failed to start daemon *

然后在运行程
序还是不行,重复搞了很多次老不行,还有朋友说在任务管理器找到adb.exe,然后关闭,重启Eclipse,我打开任务管理器,发现根本没有找到
adb.exe,这时候我流泪满面了,然后我冷静下来,知道有些朋友遇到这个错误是因为豌豆荚啥的软件占用了adb.exe的端口,我的电脑里面根本没有
安装豌豆荚,然后我想看看是谁占用adb的端口,我从网上查到adb.exe使用的端口是5037,接下来我给大家介绍解决方法

  • 查看5037端口被谁占用了,开始--运行--CMD 到命令提示符,输入 netstat -aon|findstr "5037",如下图                                              
                               ​adb server is out of date.  killing解决方法

  • 我们从上面根本就看不出5037端口被谁占用,我们需要根据后面的PID(2748)来查找占用该端口的应用程序,输入 tasklist|findstr "2748" ,如下图        
                       
                                                                           
                                                                           
                                             ​adb server is out of date.  killing解决方法 
                                                                                  注: 我这里5037端口是正确的被adb.exe占用,如果是你,就是其他的应用程序啦

  • 结束该进程,输入taskkill /f /t /im 你的进程名,例如adb.exe,如下图,在重新连接手机,这时候你会发现程序运行起来了                                    ​adb server is out of date.  killing解决方法

这个问题虽然不是什么很大的问题,但是对于新手来说也是属于比较棘手的问题,所以我将自己解决此问题的方法在这里记录下,希望能给遇到此问题的人一点点帮助,如果我写得文章对你一点帮助请帮我顶一下文章,谢谢!