Android 模拟器 - Wifi 错误
我正在使用 Android SDK 模拟器广告尝试连接到网络。我无法按照设置>中的方式进行操作无线与网络,在我需要打开 WiFi 的地方,出现“错误”
如何解决?
戈罗夫
I am using the Android SDK Emulator ad trying to connect to the web. I can not do it as in the settings > Wireless & Networks , Where i need to turn the WiFi On, i get "Error"
How to solve it?
Gorov
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
现在,它应该在状态栏中显示一个 3G 图标(或类似图标),并且您现在应该能够上网冲浪。
It should now display a 3G icon (or similar) in the status bar, and you should be now able to surf the web.
请参阅控制模拟器。
在模拟器中按 F8,这应该会启用您的数据连接。很奇怪,有时启动模拟器时连接会被禁用。
问候
Look at Controlling the Emulator.
Press F8 in the emulator, this should enable your data connection. It's weird, sometimes the connection is disabled when you start up the Emulator.
Regards
我认为,如果您在将互联网连接连接到计算机后启动模拟器,有时模拟器将无法连接到互联网...尝试先连接互联网,然后启动模拟器...
I think, sometimes emulator wont connect to internet if you start the emulator after connecting your internet connection to the computer... try connecting the internet first and then starting the emulator....
如 在 Android 模拟器上启用 Wifi 和 Android:在模拟器中模拟 WiFi?,模拟器根本不支持此功能。如果你想要wifi,你需要一个真正的设备。
正如这个问题中的其他人所说,您通常可以访问互联网:无论您的计算机使用有线还是无线网络,都可以配置模拟器的“3G”或“4G”以从主机拉出网络。但模拟器内部的“WiFi”无法正常工作。
(这个问题可能是重复的。即使我引用的两个问题中的后者也几乎是另一个问题的重复)
As stated in Enabling Wifi on Android Emulator and Android: Simulate WiFi in the emulator?, this simply isn't supported in the emulator. If you want wifi, you need a real device.
As other people in this question have stated, you can access the internet in general: whether your computer is using a wired or wireless network, it's possible to configure your emulator's "3G" or "4G" to pull the network from the host machine. But the emulator-internal "WiFi" can't work correctly.
(this question is probably a duplicate. Even the later of the two questions I referenced is almost a duplicate of the other)
您不需要“打开”AVD 的 WiFi。它应该可以使用您的计算机的互联网连接工作。当我的 AVD 上的 wifi 停止工作时(我需要重置我的 AVD),以下是对我有用的方法:
我有时会出现此问题,但在完成上述步骤后,它会再次出现。
You shouldn't need to "turn on" the wifi of the AVD. It should work using your computers internet connection. Here is what worked for me when wifi on my AVD stops working(I needed to reset my AVD):
This issue recurs for me sometimes but after I complete the above steps it works again.
以下解决方案在大多数情况下都有效。
关闭模拟器->关闭笔记本电脑wifi->在android studio中打开AVD Manager->对所需的模拟器执行冷重启 ->模拟器完全重启后,打开笔记本电脑的wifi
经过上述步骤,它可以工作。请参阅下图进行模拟器冷启动
Below solution worked in most of the cases.
close emulator->Switch off laptop wifi -> open AVD Manager in android studio-> Perform cold reboot of required emulator ->After emulator reboot completely,switch on laptop wifi
After above steps,it works.Please find below image for emulator cold boot
我在管理Android设备的VS中进行了出厂重置,然后模拟器连接到了wifi!
I made a factory reset in VS in manage android devices and after that emulator was connected to wifi!
我在使用Win7的时候也遇到过这个问题。
我不得不切换到有线连接,因为似乎没有任何效果。
F8确实是打开/关闭网络的关键,但它对我来说不起作用。
后来我切换到Ubuntu,但没有测试模拟器是否可以在Ubuntu上使用wifi。
I have also encountered this problem when I was using Win7.
I had to switch to a wired connection as nothing seemed to be working.
F8 is indeed the key to turn network on/off, but it just didn't work for me.
I later switched to Ubuntu, but didn't test whether emulator works with wifi on Ubuntu.
对我有用的是拔掉以太网电缆并启用 Wi-Fi 连接。似乎两者都混合了。
我的电脑使用 MAC,我正在使用 Eclipse。
What worked for me was to unplug my ethernet lan cable and enable my Wi-FI connection. Seems it was mixing both.
My computer uses MAC and I was working with Eclipse.
您无法在模拟器中打开 Wi-Fi。当在防火墙或代理后面工作时,这是一个特别棘手的问题。
然而,在某些情况下,仅使用以太网或 Wi-Fi 之一可能会有所帮助。
但是,如果您可以正确配置 APN,则可以通过模拟器连接到互联网。
You can't switch the Wi-Fi ON in the emulator. This is a particularly tricky issue when working behind a firewall or a proxy.
In some cases, however, using only ONE of ethernet or Wi-Fi might help.
But you can connect to the internet through the emulator if you can configure the APNs properly.
另一个可能的原因是:检查计算机上的 DNS 设置。
结果我仍然在计算机 WiFi 属性中设置了工作中的 DNS 服务器(不是模拟器 WiFi 设置)。一周以来一切都工作正常,包括模拟器直到今天。只有模拟器停止工作,其他一切仍然能够连接。擦除数据、冷启动和重新启动笔记本电脑都没有帮助。
从 WiFi 属性中删除所有 DNS 服务器、擦除数据并进行冷启动最终使其再次工作。您可能还想更新 DHCP。
Yet another possible cause: Check the DNS settings on your computer.
Turns out I still had the DNS server from my work set in the computers WiFi properties (not the Emulator WiFi settings). Everything has been working fine for a week, including the emulator until today. Only the emulator stopped working, everything else was still able to connect. Wiping data, cold booting and restarting the laptop didn't help.
Removing all DNS servers from the WiFi properties, wiping data and doing a cold boot finally made it work again. You might wanna do a DHCP renew as well.