adb server is out of date. killing/ADB server didn't ACK完美解决

1.错误信息

C:\Users\Administrator>adb shell pm uninstall -k com.***
adb server is out of date.  killing...
ADB server didn't ACK
* failed to start daemon *
error:

2.错误原因

adb端口号被占用

3.解决方法

1.查看adb端口号(如果没有修改,默认为5037):adb nodaemon server
C:\Users\Administrator>adb nodaemon server
cannot bind 'tcp:60001'
2.查看有哪些进程占用了端口号:netstat -ano | findstr "60001"(获取占用进程PID号)

1:协议 2:本地地址 3: 外部地址 4: 状态 5: PID

C:\Users\Administrator>netstat -ano | findstr "60001"
  TCP    127.0.0.1:11522        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11532        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11533        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11534        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11535        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11536        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11537        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11538        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11539        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11540        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11541        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11542        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11543        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11544        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11545        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11546        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11547        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11548        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11549        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11550        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11551        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11552        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11553        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11554        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:11555        127.0.0.1:60001        ESTABLISHED     14820
  TCP    127.0.0.1:60001        0.0.0.0:0              LISTENING       11476
  TCP    127.0.0.1:60001        127.0.0.1:11522        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11532        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11533        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11534        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11535        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11536        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11537        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11538        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11539        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11540        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11541        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11542        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11543        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11544        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11545        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11546        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11547        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11548        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11549        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11550        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11551        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11552        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11553        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11554        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:11555        ESTABLISHED     11476
  TCP    127.0.0.1:60001        127.0.0.1:12138        TIME_WAIT       0
  TCP    127.0.0.1:60001        127.0.0.1:12160        TIME_WAIT       0
  TCP    127.0.0.1:60001        127.0.0.1:12183        TIME_WAIT       0
3.查看占用进程名称:tasklist | findstr "14820"
C:\Users\Administrator>tasklist | findstr "14820"
studio64.exe                 14820 Console                    1  1,729,576 K
4.kill占用进程:taskkill /f /pid 14820(有两个的话,应该kill两个)
C:\Users\Administrator>taskkill /f /pid 14820
成功: 已终止 PID 为 14820 的进程。
C:\Users\Administrator>taskkill /f /pid 11476
成功: 已终止 PID 为 11476 的进程。

再运行adb devices就没有问题了

你可能感兴趣的