4

How do I simulate a WiFi network using the Emulator?

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
Bear35645
  • 193
  • 1
  • 3
  • 14

3 Answers3

2

Simple answer: you can't. Also, this has been asked before (and yes, it's still valid).

Community
  • 1
  • 1
Felix
  • 88,392
  • 43
  • 149
  • 167
1

The emulator does not emulate WiFi specifically. It emulates a generic network connection. You can use telnet commands to configure its characteristics (e.g., speed, latency).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • You have more rep than me. Can you please edit the question and fix the title? The "Imulator" makes me cringe :) – Felix Aug 03 '10 at 20:43
0

Here is the solution I came up with for simulating total network connection loss on the emulator:

Write the following script and name it "nonetwork.sh"

netcfg eth0 down
sleep 10
netcfg eth0 up
netcfg eth0 dhcp

Upload the following script to the emulator via this command:

adb push nonetwork.sh /data/local/nonetwork.sh

Change the permissions

adb shell chmod 700 /data/local/nonetwork.sh

Run it

adb shell /data/local/nonetwork.sh

While the network is down on the device you'll lose access to adb as well but once the connection is re-established it will work again. Hope this helps.

Bellinghammer
  • 185
  • 3
  • 9