Android:在模拟器中模拟 WiFi? [英] Android: Simulate WiFi in the emulator?
问题描述
我想通过我的应用程序检查设备是否具有 WiFi 连接,但为了做到这一点,我必须首先找到一种在模拟器中获取WiFi"的方法.只需转到设置 -> 无线控制 -> Wifi 说无法启动 Wi-Fi,而 logcat
说:
I would like to check from my app whether the device has WiFi connectivity, but in order to do that, I must first find a way to get "WiFi" in the emulator. Just going to Settings -> Wireless controls -> Wifi says Unable to start Wi-Fi, while logcat
says:
E/WifiService( 566): Failed to load Wi-Fi driver.
D/SettingsWifiEnabler( 695): Received wifi state changed from Unknown to Enabling
D/SettingsWifiEnabler( 695): Received wifi state changed from Enabling to Unknown
如何在模拟器中模拟 WiFi 连接?
How can I simulate WiFi connectivity in the emulator?
推荐答案
由于这似乎是一个热门问题,我将继续添加更新的答案.SDK 仍然不支持 WiFi 仿真,但 Genymotion 默认支持 WiFi,因此您可以使用它来开发/test 具有特定 WiFi 功能的应用.
Since this seems to be a popular question, I'll go ahead and add an updated answer. The SDK still doesn't support WiFi emulation, but Genymotion does WiFi by default, so you can use that to develop/test apps with specific WiFi functionality.
这篇关于Android:在模拟器中模拟 WiFi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!