Toggle Wifi method for Appium dot net driver 1.2.0.8

I start using new version of appium dot net driver and can`t find ToggleWifi() in AppiumDriver or AndroidDriver object. Please help, I have test in which I turn off Wifi .

It seems that those ToggleWifi has been removed. and you can set WifiOnly to the connectionType property.

You can use this:

In your code, you can have:

Wifi On:
Runtime.getRuntime().exec("cmd /C " + “adb shell am start -n io.appium.settings/.Settings -e wifi on”);

Wifi Off:
Runtime.getRuntime().exec("cmd /C " + “adb shell am start -n io.appium.settings/.Settings -e wifi off”);

@mitsram @Ethan Thanks a lot! I will try this!