Need to automate network switching from 4G and Wi-Fi

Hello everyone,

I am new to Appium.
I need to do automation Network switching from Wi-Fi to 4G and 4G to Wi-Fi.
Can anyone please help me to get automate this. I am using headspin cloud devices.


just enable/disable WiFi. with android you can use ->

I don’t find option toggleWifi () in eclipse. Do i need to modify something ?
Below is desired capabilities


public void SetupSafari() throws MalformedURLException {

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();

desiredCapabilities.setCapability(“deviceName”, “iPhone”);

desiredCapabilities.setCapability(“udid”, “XXX”);

desiredCapabilities.setCapability(“automationName”, “XCUITest”);

desiredCapabilities.setCapability(“platformName”, “iOS”);

desiredCapabilities.setCapability(“platformVersion”, “12.4”);

desiredCapabilities.setCapability(“browserName”, “Safari”);

URL remoteUrl = new URL(“XXXXX”);

base.Driver = new IOSDriver(remoteUrl, desiredCapabilities);


If anyone have any network switching script snippet. Could you please share as sample.
Thankyou in advance.

iOS = NO support


((AndroidDriver) driver).toggleWifi();

Oh…Thanks much…

Any alternate option for iOS ?