adb server is out of date. linux,adb server is out of date. killing完美解决
原本是想跑monkey測試的,可使用adb命令時提示:adb server is out of date. killing...
出現這個問題的原因是:adb使用的端口5037被占用了。下面我們說下如何找到是哪個程序占用了這個端口,順便看看cmd里面的一些類似linux的進程操作。
1.錯誤信息:
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. 原因:
adb的端口(5037)被占用了。至于這個5037端口,可以參考本博客另外 一篇文章:
在這個文章里,詳細說明了adb的原理及其源碼分析。
3. 解決辦法:
(1)查看adb的端口號是多少:?adb nodaemon server
c:\users\admin>adb nodaemon server
cannot bind 'tcp:5037'
提示:無法綁定5037端口
(2)查找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)找到占用端口進程對應的應用程序 :tasklist | findstr "10760"
c:\users\admin>tasklist | findstr "10760"
ppadbserver.exe 10760 console 1 6,044 k
(4)此時有2個方法殺死進程:
方法1,通過任務管理器,進程中找到ppadbserver.exe ,結束進程即可。此方法省事高效。
如果想多學習cmd命令,可以用下面方法
方法2:taskkill /f /pid 10760
c:\users\admin>taskkill /f /pid 10760
成功: 已終止 pid 為 10760 的進程。
4. 重現啟動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]
參考文檔:https://blog.csdn.net/liranke/article/details/42524851
總結
以上是生活随笔為你收集整理的adb server is out of date. linux,adb server is out of date. killing完美解决的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java应用程序多态_java – 多态
- 下一篇: python闪光培训班 费用-Pytho