I am trying to turn off my data network with the io.appium.settings/.Settings app and it doesn’t seem to work. (wifi interaction commands work perfectly).
The command suggested on GitHub starts the app, it prompts the correct message (Enabling / Disabling data connection), but it does not do anything (data network status remains unchanged).
The command I am trying to run is: adb shell am start -n io.appium.settings/.Settings -e data off
All the devices I tried it on are 4.4 + and the io.appium.settings app is the one that Appium pushes to the device. Also, my OS is Windows.
I meant using the same command as Appium framework does , the .Settings app only controls WiFi and Data, but appium also provides solution to interact with airplane mode, but not through this app. Perhaps I should edit the post since it is related to the .Settings app.
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
You can get access to adb through any normal shell/system access. In Ruby it would be as simple as
adb_output = adb shell #{command}
Access to adb is limited in Appium so that Grid Providers can support Appium and not worry about customers trashing their devices. On our project, we have created an adb class that provides limited access to adb command we expect will eventually be integrated into Appium.
What do you mean “worked” ? Did it disable / enable data connection? Or did it just start the .Settings acticity and prompted a message about data connection?
For Enabling data Connection : adb shell am start -n io.appium.settings/.Settings -e data on
& for Disabling : adb shell am start -n io.appium.settings/.Settings -e data off .
I got a message in my mobile stating that, enabling data connection, and then it turn on mobile data. I have checked it , it works fine.
What version of Appium are you using? I’m on 1.3.5. I see the appium settings window appear and go away, but when I check mobile data in settings, it remains unchanged.