Enable/Disable data network not working

Thanks, @Gourav_jain. Was this an emulator, or real device, and which kind model/emulator in either case?

As a side note, the wifi command was always working,for me at least, on ANY device (phone/tablet) or firmware (4.4 / 5.0) that I used.
The problem is with cellular data command, thats the one that never worked for me.

@willosser: I am testing on real device. (Micromax a99 is device model).

Hi Sealview,
adb shell am start -n io.appium.settings/.Settings -e data off/on is this not working for you? I hope you are using latest appium, and Android version.

Hi Gourav,

I am using latest appium version (1.4.14) and latest appium java client libraries (3.2.0).

Running the above adb command simply opens the .Settings activity and prompts a message (Disabling/Enabling data service) but nothing happens on my Xperia Z2 with API level 22.

On my galaxy S2 with API level 16 the commands work ok, but this device is rooted… xperia z2 is not

It depends on the device.

On my tests I run couple commands to disable/enable data and then I have some set of instructions for specific devices. In those cases I open settings activity and then go and tap on the switch to disable/enable data.

Is there any command for iOS?

Hi Guys,
I am new to Appium is there any way to disable the WIFI of android phone through Appium at run time. I would prefer an reply in Java