简体   繁体   English

Android模拟器有时无法连接到互联网

[英]Android emulator sometimes does not connect to the internet

I have ubuntu Linux 10.04, my collegue uses suse. 我有ubuntu Linux 10.04,我的同事使用suse。 We have Wi-Fi connection to the Internet. 我们有互联网的Wi-Fi连接。 We use Android emulator with several virtual devices. 我们将Android模拟器与多个虚拟设备配合使用。 We have problem with the Internet connection of the virtual devices. 我们遇到虚拟设备的Internet连接问题。 Normally it works well but sometimes (about 25%) the virtual device shows no GSM signal and no Internet even if the PC is connected. 通常它运行良好但有时(约25%)虚拟设备显示没有GSM信号,即使连接了PC也没有互联网。 There is no clear reason of that behaviour. 这种行为没有明确的原因。 It will stay disconnected forever so if it happens, we will have to restart the virtual device and hope that the next attempt will be OK. 它将永远保持断开连接,所以如果它发生,我们将不得不重新启动虚拟设备,并希望下一次尝试没问题。 It happens sometimes to all Android version virtual device but it is more common on Android 2.x than Android 1.x. 它有时会发生在所有Android版本的虚拟设备上,但它在Android 2.x上比Android 1.x更常见。 Does anybody have the same error? 有没有人有同样的错误?

I suggest using the new snapshot feature to save a good snapshot to restore from with the network up. 我建议使用新的快照功能来保存一个好的快照,以便从网络恢复。 I've done this with my CI build and it appears to have solved the problem. 我用我的CI构建完成了这个,它似乎解决了这个问题。

I have the same error on Windows. 我在Windows上有同样的错误。 What seems to work for me is is treating the VD like a real phone and turning it off before shutting the window - so press and hold the power button, then selecting power off from the popup dialog then give it a short while to shutdown (if you watch from the DDMS logcat view in Eclipse you can see it running through the shutdown processes) . 对我来说似乎有用的是将VD视为真正的手机并在关闭窗口之前将其关闭 - 所以按住电源按钮,然后从弹出对话框中选择关闭电源,然后暂停关机(如果你从Eclipse中的DDMS logcat视图中观察,你可以看到它在关机过程中运行) It won't actually close the window, but you will see the logcat activity basically stop. 它实际上不会关闭窗口,但您会看到logcat活动基本上停止。 Then close the window. 然后关上窗户。

I find if I close the VD like this, I don't get any problems when I next come to start the VD, but if I don't maybe even 1 in 3 times it won't start properly the next time. 我发现如果我这样关闭VD,当我下次启动VD时我没有遇到任何问题,但是如果我连三次都没有,那么下次它将无法正常启动。

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

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