androidtestingandroid-emulatorwifidevice-emulation

Android: Simulate WiFi in the emulator?


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

How can I simulate WiFi connectivity in the emulator?


Solution

  • 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.