Toggle settings in Android device or emulator.
A small and simple Android application that deals with the system settings. Then the application shuts down.
$ cd into/this/repo
$ ant debug
You can also run ant debug install
to build and immediately deploy the app to a connected Android device or emulator.
You can install the apk through the Android Debug Bridge.
To install:
$ cd into/this/repo
$ adb install bin/settings_apk-debug.apk
To uninstall:
$ adb uninstall io.appium.settings
Once installed on a device, you can change the wifi
and data
settings through the following commands:
To turn on wifi
:
$ adb shell am start -n io.appium.settings/.Settings -e wifi on
To turn off wifi
:
$ adb shell am start -n io.appium.settings/.Settings -e wifi off
To turn on data
:
$ adb shell am start -n io.appium.settings/.Settings -e data on
To turn off data
:
$ adb shell am start -n io.appium.settings/.Settings -e data off
The two can be changed at the same time, as well:
$ adb shell am start -n io.appium.settings/.Settings -e wifi on -e data off
Voila!
There are certain system services which cannot be accessed through an application. Two ones central here are airplane_mode
and gps
.
Apache License 2.0