“adb install”返回错误:协议错误(无状态)

问题描述 投票:3回答:3

我已经创建并运行了几个Android模拟器,现在我想在它们上安装应用程序。这是我尝试几次的故事:

$ adb -s emulator-5562 install xxx.apk 
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: protocol fault (no status)
- waiting for device -
^C
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
emulator-5554   device
emulator-5556   device
emulator-5558   device
emulator-5560   device
emulator-5562   device
$ adb -s emulator-5562 install xxx.apk 
error: protocol fault (no status)
- waiting for device -
^C
$ killall adb
$ killall adb
adb: no process found
$ adb -s emulator-5562 install xxx.apk 
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
3748 KB/s (766384 bytes in 0.199s)
    pkg: /data/local/tmp/xxx.apk <- sometime it reaches upto here but it stays there for ever
^C

你能帮我解决一下我能做些什么来检查问题吗?谢谢

android adb avd
3个回答
6
投票

“adb install”返回错误:协议错误(无状态):

解决方案是

使用终端转到\platform-tools并执行以下命令

set ADB_TRACE=1
adb start-server

要从ADB设备列表中删除模拟器:

打开“Android Virtual Device Manager” - >选择要删除的模拟器 - >单击“删除”按钮。

见下图


2
投票

对我来说,它原来是一个过时的ADB服务(过时的平台工具)。 它仍然可能是一个过时的驱动程序,但由于驱动程序大多数时间没有更新,请确保您已通过SDK Manager安装了最新版本的Android SDK Platform-tools:

我还读到,安装Android Studio时可能会出现问题。然后,您必须通过“工具 - > Android”(取消选中)禁用ADB集成。之后,使用adb kill-serveror重启你的adb服务器,只需重新启动计算机即可。


0
投票

我遇到了它,因为连接了多个ADB设备。

断开除了我正在使用的设备之外的所有设备都为我工作。

© www.soinside.com 2019 - 2024. All rights reserved.