Genymotion中运行的虚拟设备会定期在ADB中脱机 [英] Virtual device running in Genymotion periodically goes offline in ADB

查看:99
本文介绍了Genymotion中运行的虚拟设备会定期在ADB中脱机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行在Genymotion 2.4中的Android设备(带有Lollipop映像,如果重要的话),并通过Eclipse在本地网络中从另一台开发人员PC通过ADB(版本1.0.32)连接到它,而没有连接问题。除定期断开ADB连接(其他协议保持正常)外,其他一切都很好,这是ADB丢失了设备,当我尝试重新连接时,它说该设备脱机。根据我的经验,这种离线状态基本上意味着接收端(设备)仍然认为它已连接并且拒绝了新连接。我知道解决此问题的唯一方法是重新启动设备,然后ADB按预期方式连接到该设备。

I have an Android device (with Lollipop image, if important) running in Genymotion 2.4 and connect to it via ADB (version 1.0.32) from another developer PC with Eclipse in local network without connectivity problems. All is fine except for periodical drops of ADB connection (other protocols keep working fine), that is ADB loses the device, and when I try to reconnect it says that device is offline. From my experience, this offline status does basically mean that the receiving end (the device) still thinks it's connected and declines new connection. The only method I know to remedy this problem is to restart the device and then ADB connects to it as expected.

如果有人感兴趣,则表明ADB不在远程运行

If someone is interested, ADB is not running on the remote host machine with Genymotion - otherwise the remove connections from other PCs would be impossible.

问题:我如何软刷新虚拟设备以接受新的ADB连接,而无需其他计算机重新启动整个设备?

The question: how can I refresh "softly" the virtual device to accept new ADB connection without restarting entire device?

PS如果我将离线设备留出一段时间(例如,很长一段时间,例如一个小时),似乎无需外部干预即可刷新其状态,因此ADB能够再次正确连接到该设备,并且报告为线上。但是,等待这么长的时间没有道理。

P.S. If I leave the "offline" device for its own for some time (quite a long time, for example, for an hour) it seems refreshes its state without external interaction, so ADB is again able to properly connect to and device is reported as "online". But, it makes no sense to wait so long for this to happen. This is just a new piece of information for consideration.

推荐答案

这可能对您不起作用,但是在我的设备仅使ADB脱机的情况。关于您的问题的评论之一提到,当他们的设备进入睡眠状态时,他们的模拟器通常会脱机。我的雷同,尽管长时间没有活动,但长时间不活动之后,它也下线了。无论如何,我的解决方法很简单:

This may not work for you, but has worked for me in the situation where my device simply goes ADB offline. One of the comments on your question mentions that their emulator typically goes offline when their device sleeps. Mine does the same and also goes offline after long periods of inactivity, despite not actually sleeping. Anyway, my fix is plain and simple:

在终端中,导航至安装SDK的位置。然后,导航到SDK中的目录platform-tools,并发出以下命令:

In terminal, navigate to where you have the SDK installed. Then, navigate to the directory platform-tools within your SDK, and issue the following command:

adb kill-server

完成后,键入以下内容:

After that finishes, type this one:

adb devices

这几乎总是可以解决我的问题,希望如此也可以解决您的问题。让我知道这对您如何工作。

That almost always fixes my problem, and I hope it fixes yours as well. Let me know how that works for you.

这篇关于Genymotion中运行的虚拟设备会定期在ADB中脱机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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