如何杀死ADB fork服务器

时间:2019-05-08 09:45:38

标签: android macos adb macos-mojave adb-shell

e#背景 我将Android Studio更新为3.4版(我记得我看到一个对话框,提示我删除旧的Android Studio配置文件,其中一些文件大小> 1GB,我很高兴地点击了!)。

但是突然我的adb命令停止了工作:

adb shell
adb server version (37) doesn't match this client (40); killing...
ADB server didn't ACK
Full server startup log: /var/folders/1b/3wwzdg214cz57k2nccl_9d5c0000gn/T//adb.501.log
Server had pid: 32161
--- adb starting (pid 32161) ---
adb I 05-08 12:38:07 32161 895177 main.cpp:56] Android Debug Bridge version 1.0.40
adb I 05-08 12:38:07 32161 895177 main.cpp:56] Version 4986621
adb I 05-08 12:38:07 32161 895177 main.cpp:56] Installed as /Users/Shared/Library/Android/sdk/platform-tools/adb
adb I 05-08 12:38:07 32161 895177 main.cpp:56]
adb E 05-08 12:38:07 32161 895185 usb_osx.cpp:159] Unable to create an interface plug-in (e00002be)
adb I 05-08 12:38:07 32161 895177 auth.cpp:421] adb_auth_init...
adb I 05-08 12:38:07 32161 895177 auth.cpp:174] read_key_file '/Users/abdullah/.android/adbkey'...
adb server killed by remote request

* failed to start the daemon
error: cannot connect to the daemon

我当前的adb版本是1.4:

adb version
Android Debug Bridge version 1.0.40
Version 4986621
Installed as /Users/Shared/Library/Android/sdk/platform-tools/adb

我到处搜索了运行37版本的地方(以便我可以将其杀死),但找不到任何东西。我能找到的最接近的东西是这样:

ps aux | grep adb
abdullah         32176   0.6  0.0  4356908   8156   ??  S    12:38PM   0:02.44 adb fork-server server

哪个似乎正在运行的服务,每次我杀死它,尽管它再次启动:

$ kill 32176
$ ps aux | grep adb
Abdullah         15806   0.7  0.0  4295468   8048   ??  S    12:44PM   0:00.05 adb fork-server server

问题

如何杀死这个adb fork-server,以便摆脱我的adb的37实例?

我尝试过的

我尝试先运行adb kill-server,然后再运行adb start-server,但遇到相同的错误

更新

我尝试按照说明here将我的adb shell降级到1.0.37版 但是继续使用previous list的Android平台工具,我发现以下版本的映射如下:

  • platform-tools_r25.0.5-darwin.zip 1.0.39
  • platform-tools_r25.0.4-darwin.zip 1.0.39
  • platform-tools_r25.0.3-darwin.zip 1.0.36

因此1.0.37不在列表中!!!!

更新

我刚意识到这与我尝试在笔记本电脑上对平板电脑进行屏幕镜像的同时发生,所以我安装了vysor。这可能与它有关: enter image description here

1 个答案:

答案 0 :(得分:0)

您刚刚忘记了-9

也许使用kill -9 <PID>。就像以下命令一样。

ps x -o pid -o command | awk '/fork-server/{print $1}' | \
    for i in `xargs`; do \
      kill -9 "$i";\
    done

尝试一下!