apk的文件传输失败

时间:2014-12-20 22:11:15

标签: android adb wear-os

普通文件传输工作正常(1.56MB和6.7MB),但apk(1.81MB)失败:

>adb -s localhost:4444 push IMG_20141219_210043.jpg /storage/sdcard0/Download
45 KB/s (1637405 bytes in 35.128s)

>adb -s localhost:4444 push javamagazine20120708-dl.pdf /storage/sdcard0/Download
40 KB/s (7035111 bytes in 171.628s)

>adb -s localhost:4444 push wear-debug.apk /storage/sdcard0/Download
protocol failure

通过Android Studio安装时也是如此:

Waiting for device.
Target device: motorola-moto_360-localhost:4444
Uploading file
  local path: C:\workspace\Heating\wear\build\outputs\apk\wear-debug.apk
  remote path: /data/local/tmp/com.mypackage.heating
I/O Error: An existing connection was forcibly closed by the remote host

整个下午(以及之前一个月)开始测试磨损(Moto360)没有问题,突然AS开始失败I/O Error: An existing connection was forcibly closed by the remote host

尝试重新启动磨损,手机,PC,adb,同样的结果......

想法?

2 个答案:

答案 0 :(得分:1)

有些Android设备不允许.apk文件传输,例如你无法在Nexus 5上发送或接收.apk文件...我不确定你的佩戴设备但可能是案例......作为一个解决方案,您可以将apk文件重命名为其他(我通常使用.mp3)并尝试在此之后发送文件。 ;)然后在你的穿戴设备重命名为.apk:D

答案 1 :(得分:0)

adb push和Studio安装失败的真正原因:错误的USB连接线 :(

使用不同的线缆一切正常,甚至是APK推送:

C:\workspace\Heating\wear\build\outputs\apk>adb -s localhost:4444 push wear-debug.apk /storage/sdcard0/Download
45 KB/s (1907880 bytes in 40.722s)