本文主要是介绍adb启动失败解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、问题
Mac中Android studio连接手机,经常连接不上,或者安装应用的时候经常掉线,报错daemon not running; starting now at tcp:5037
具体报错信息如下:
./adb start-server
daemon not running; starting now at tcp:5037
ADB server didn't ACK
Full server startup log: /var/folders/qs/4rm57lbs2hq4xtf0_xt4x1k80000gn/T//adb.501.log
Server had pid: 4153
--- adb starting (pid 4153) ---
adb I 04-10 11:19:03 4153 492872 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 04-10 11:19:03 4153 492872 main.cpp:57] Version 27.0.0-4455170
adb I 04-10 11:19:03 4153 492872 main.cpp:57] Installed as /Users/XXX/Library/Android/sdk/platform-tools/./adb
adb I 04-10 11:19:03 4153 492872 main.cpp:57]
adb E 04-10 11:19:03 4153 492874 usb_osx.cpp:159] Unable to create an interface plug-in (e00002be)
adb I 04-10 11:19:03 4153 492872 adb_auth_host.cpp:416] adb_auth_init...
adb I 04-10 11:19:03 4153 492872 adb_auth_host.cpp:174] read_key_file '/Users/carl/.android/adbkey'...
adb F 04-10 11:19:03 4153 492878 transport_usb.cpp:37] Check failed: usb_packet_size < 4096ULL (usb_packet_size=5120, 4096ULL=4096)
failed to start daemon
error: cannot connect to daemon
2、解决方法
1、无效方法
在stackoverflow上查的时候有其他人也遇到这种问题
按照方法在Android studio的命令窗口中输入:
- adb kill-server
- adb start-server
但是问题依然无法解决,还有一种方法是: Open task manager (of your OS) and kill adb.exe process
但是在mac中根本找不到adb.exe程序,并且已经删掉了java进程依然无法解决,重启电脑和Android studio 依然会有这种问题。
2、有效方法
It is a bug with the latest version of the platform tools (27.0.0), the solution I found was to downgrade to the previous version.
也就是说这个问题是由于platform tools (27.0.0)导致的,可以将这个platform tools版本回退到之前的版本。
在Android studio的命令行中输入下面命令就可以了
cd $ANDROID_HOME && rm -rf platform-tools/ && curl https://dl.google.com/android/repository/platform-tools_r26.0.2-darwin.zip -o platform-tools_r26.0.2-darwin.zip && unzip platform-tools_r26.0.2-darwin.zip
其中ANDROID_HOME是sdk所在的目录,参考下面命令
cd /Users/hanking/Library/Android/sdk/ && rm -rf platform-tools/ && curl https://dl.google.com/android/repository/platform-tools_r26.0.2-darwin.zip -o platform-tools_r26.0.2-darwin.zip && unzip platform-tools_r26.0.2-darwin.zip
3、参考
1、(https://stackoverflow.com/questions/23104394/daemon-not-running-starting-it-now-on-port-5037)
2、https://stackoverflow.com/questions/47665475/android-studio-adb-start-server-fails-adbkey-check-fails
这篇关于adb启动失败解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!