简体   繁体   English

当USB电缆循环时,Android ADB-over-WiFi仍会断开连接(?!?)

[英]Android ADB-over-WiFi still disconnects when USB cable is cycled (?!?)

I am working on a USB-based project so I'm using ADB over WiFi TCP/IP. 我正在开发一个基于USB的项目,所以我通过WiFi TCP / IP使用ADB。 Works perfectly, and frankly this ability to debug over a wireless connection is one of the coolest development tricks I've used in years. 工作完美,坦率地说,这种通过无线连接进行调试的能力是我多年来使用的最酷的开发技巧之一。 Really, really cool. 真的,非常酷。

I'm working on the various Intents associated with USB connects and disconnects. 我正在研究与USB连接和断开连接相关的各种Intent。 I've found that anytime the USB cable's physical status changes - whether it's plugged in or unplugged - the ADB wireless connection is lost. 我发现只要USB线的物理状态发生变化 - 无论是插入还是拔掉 - ADB无线连接都会丢失。 I can reestablish it and resume debugging via DDMS, but by then a whole lot of CPU time has gone by. 我可以重新建立它并通过DDMS恢复调试,但到那时已经耗费了大量的CPU时间。 This makes debugging USB connection events basically impossible. 这使得调试USB连接事件基本上不可能。

I cannot understand why ADB would still take action on USB events when it is connected via TCP/IP (over WiFi, no less). 我无法理解为什么ADB在通过TCP / IP(通过WiFi连接)连接时仍会对USB事件采取行动。 Is there an ADB configuration detail I'm missing? 我缺少ADB配置细节吗? How do you tell ADB to ignore USB since it's not running over USB anyway? 你怎么告诉ADB忽略USB,因为它还没有通过USB运行?

Thanks! 谢谢!

I had the same issue and i think managed to solve it by "Revoke USB debugging authorizations" 我有同样的问题,我想通过“撤销USB调试授权”设法解决它

I then connected over usb and allowed my PC 然后我通过usb连接并允许我的PC

Then restarted adb in tcpip mode and connected to my device. 然后以tcpip模式重新启动adb并连接到我的设备。

It stayed connected when I disconnected the USB cable. 断开USB线时,它保持连接状态。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM