android adb no devices found,关于 adb shell error: no devices/emulators found 的解决方案

今天更新了 SDK Tools 的版本之后,打开命令行发现 adb shell 突然不能用了

报错如下:

$ adb shell

adb server version (40) doesn't match this client (41); killing...

ADB server didn't ACK

Full server startup log: /var/folders/hv/5bc7sv6s7y7807qp6tt43fz40000gn/T//adb.501.log

Server had pid: 1022

--- adb starting (pid 1022) ---

adb I 06-06 21:45:58 1022 9222 main.cpp:60] Android Debug Bridge version 1.0.41

adb I 06-06 21:45:58 1022 9222 main.cpp:60] Version 29.0.0-5611747

adb I 06-06 21:45:58 1022 9222 main.cpp:60] Installed as /Users/binguner/Library/Android/sdk/platform-tools/adb

adb I 06-06 21:45:58 1022 9222 main.cpp:60]

adb E 06-06 21:45:58 1022 9225 usb_osx.cpp:159] Unable to create an interface plug-in (e00002be)

--- adb starting (pid 1024) ---

adb I 06-06 21:45:58 1024 9229 main.cpp:56] Android Debug Bridge version 1.0.40

adb I 06-06 21:45:58 1024 9229 main.cpp:56] Version 86

adb I 06-06 21:45:58 1024 9229 main.cpp:56] Installed as /Applications/Genymotion.app/Contents/MacOS/player.app/Contents/MacOS/tools/adb

adb I 06-06 21:45:58 1024 9229 main.cpp:56]

adb E 06-06 21:45:58 1024 9231 usb_osx.cpp:159] Unable to create an interface plug-in (e00002be)

adb I 06-06 21:45:58 1022 9222 auth.cpp:436] adb_auth_init...

adb server killed by remote request

--- adb starting (pid 1026) ---

* failed to start daemon

error: cannot connect to daemon

然后开始各种百度、谷歌。。。总结了一下解决方案如下:

修改 Genymotion 使用的 SDK 版本为系统本地的 SDK 版本

查看本地 SDK 的环境变量版本是否正确

adb kill-server 然后 adb start-server

查看进程占用情况,模拟器端口是否被手机助手占用

....

但这些解决方案我这里统统失效,查看我的报错信息,确实是我使用的 ADB 版本和虚拟机的 ADB 版本不一样所导致的原因,然后我把 Genymotion 的 SDK 路径修改成本地 SDK 的路径之后。

$ adb shell

error: no devices/emulators found

欲哭无泪。。。

但是突然想到以前用过 adb connect 去无线连接过同一网络环境下的 Android 设备,那么我能不能用 adb connect 去连接这部虚拟机呢?

$ ps aux | grep adb

binguner 1505 0.0 0.0 4295704 848 s000 R+ 9:48PM 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn adb

binguner 1149 0.0 0.0 4290856 1568 ?? S 9:47PM 0:00.01 /Users/binguner/Library/Android/sdk//platform-tools/adb -s 192.168.57.102:5555 logcat -v time

binguner 1146 0.0 0.0 4338192 2832 ?? Ss 9:47PM 0:00.26 adb -L tcp:5037 fork-server server --reply-fd 11

192.168.57.102:5555 是手机的 ip 和端口,然后使用 adb connect

$ adb connect 192.168.57.102:5555

connected to 192.168.57.102:5555

最后输入熟悉的 adb shell 命令

$ adb shell

root@vbox86p:/ #

问题解决!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值