adb wifi经常掉线,如何保持adb在线? [英] adb wifi often go offline, how to keep adb online?

查看:433
本文介绍了adb wifi经常掉线,如何保持adb在线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Android 平板电脑通过 USB 端口与 USB 设备通信,平板电脑只有一个 USB 端口,所以我使用 adb wifi 作为我的调试工具.但是,当我通过WIFI连接adb时,连接不会保持很长时间(我们通常只有几分钟),如何保持adb wifi连接一直在线?另一个问题,是否可以使用USB HUB将平板电脑与USB闪存驱动器和我的电脑连接起来,并保持adb运行?非常感谢!!!

I'm using Android tablet communicating with a USB device through USB port, the tablet only has one usb port, so I use adb wifi as my debug tool. However, when I connect adb through WIFI, the connection won't keep long(only a few minutes us usually), how to keep the adb wifi connection online all the time? Another question, is it possible to use USB HUB to connect the tablet with both USB flash-drive and my computer, and keep adb running? Many thanks!!!

推荐答案

以下是我在一周多的时间里到处研究和自己开发的结果.

Here is what I found out from researching everywhere and developing on my own for more than a week.

A1.不时调用 adb 命令使 adb 服务器保持在线.

A1. calling adb commands time to time keeps adb server online.

A2.在连接的设备上检查 wifi 之前,请检查运行 ADB 服务器的 wifi.Ping 到 google,如果连接良好,则 ping 到设备.
无线可以自行断开连接,甚至有线连接有时也会断开.所以当设备尚未连接时调用adb connect ..."是必要的.您可以通过保存adb devices > device.txt"并查询您预期的wifi是否在列表中来轻松完成此操作.如果没有,请重新连接..(在另一个线程中执行此操作).

A2. Before you check your wifi on the connected device, check the wifi that your ADB server is running on. Ping to google and if it is well connected, ping to the device.
Wireless can disconnect on its own and even wired connection is sometimes disconnected. so calling "adb connect ..." when the device is not already connected is necessary. You could do this easily by saving "adb devices > device.txt" and query out whether your expected wifi is on the list. If not, connect again..(do this in another thread).

A3.这是因为通过 TCP/IP 连接,您的 ADB 服务器现在处于 Time_Wait 状态.上次连接中断,下一次连接现在离线,因为上次连接没有完全关闭.您可以手动断开/连接设备的 wifi 或通过 ex) "adb tcpip 5555" 重新启动 TCPIP 连接如果您想自动执行此操作,则必须以编程方式断开/连接设备的 wifi.

A3. This is because by TCP/IP connection your ADB server is now on Time_Wait stance. The last connection was interrupted that the next connection is now offline because the last connection is not completely shut down. You can either manually disconnect/connect your device's wifi or restart TCPIP connection by ex) "adb tcpip 5555" If you want to do this automatically, you are going to have to disconnect/connect your device's wifi programmatically.

这篇关于adb wifi经常掉线,如何保持adb在线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆