0

I have an emulator that I want to simulate the loss of a data connection while in my app. I have the receiver's setup correctly but I need a way to change the data connection via adb.

Is there an ADB command that turns off the data connection?

browep
  • 5,057
  • 5
  • 29
  • 37

2 Answers2

5

You can connect to an emulator via telnet

telnet localhost 5554

once connected you can set the network speed.

network speed 0

or

gsm data off 

maybe you find this link helpful.

https://developer.android.com/studio/run/emulator-console#querycontrol

Dr.jacky
  • 3,341
  • 6
  • 53
  • 91
n3utrino
  • 2,361
  • 3
  • 22
  • 32
  • What about a real device? telnet doesn't work. And after `shell` command, `network` and `telnet` commands not exist! – Dr.jacky Jan 26 '23 at 10:29
0

From DDMS Perspective in Eclipse set denied/unregistered value for voice and data. It works in the Android Emulator 1.5.


Check out this thread: Internet connection in android emulator

Community
  • 1
  • 1
Manus Reload
  • 1
  • 2
  • 2