我刚刚在 linux 上安装了 SDK。我以前用过它,因为我去年做了一些 android 工作,当时我对这些工具没有任何问题。
但是当前安装不会安装到模拟器上。 avd
启动并运行模拟器:
> adb devices
List of devices attached
emulator-5554 device
> adb install blahblah.apk
error: protocol fault (no status)
- waiting for device -
挂,直到我杀了它。然后:
> adb devices
List of devices attached
> adb kill-server
> adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
> adb devices
List of devices attached
emulator-5554 device
> adb -s emulator-5554 install blahblah.adk
error: protocol fault (no status)
- waiting for device -
作为普通用户和 root,我一定经历过十几次。我阅读了这个问答并尝试了同样的事情ADB_TRACE
。这在杀死和重新启动服务器时产生了奇怪的区别:
> adb start-server
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:version
system/core/adb/adb_client.c::adb_connect():adb_connect: service host:start-server
* daemon not running. starting it now on port 5037 *
ADB server didn't ACK
* failed to start daemon *
如果没有跟踪,它总是“守护程序启动成功”。但随后adb devices
再次显示模拟器。现在尝试adb install
会产生丰富的调试输出,并且就在“错误:协议错误(无状态)”之前:
system/core/adb/transport.c::readx():readx: fd=3 disconnected
system/core/adb/adb_client.c::adb_connect():adb_connect: return fd -1
error: protocol fault (no status)
然后在“等待设备”之前:
system/core/adb/transport.c::readx():readx: fd=3 wanted=4 got=4
4641494c FAIL
system/core/adb/transport.c::readx():readx: fd=3 wanted=4
system/core/adb/transport.c::readx():readx: fd=3 wanted=4 got=4
30303130 0010
system/core/adb/transport.c::readx():readx: fd=3 wanted=16
system/core/adb/transport.c::readx():readx: fd=3 wanted=16 got=16
646576696365206e6f7420666f756e64 device not found
system/core/adb/adb_client.c::switch_socket_transport():Switch transport failed
system/core/adb/adb_client.c::adb_connect():adb_connect: return fd -1
我在网上没有找到类似的报道。