Enable and Disable Android Accessibility Settings from the Command Line using AD...
source link: https://gist.github.com/mrk-han/67a98616e43f86f8482c5ee6dd3faabe
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Using ADB to control Accessbility settings for easier testing with Android Emulators + Real Devices
It's a lot easier to test accessibility on the fly using ADB. This gist attempts to make the days of navigating through the Android device settings UI to change Accessibility settings obsolete.
These ADB commands will hopefully encourage Android developers to test and use their apps with common Accessiblility settings enabled.
Credit to James Nitsch for inspiring this, and for figuring out the put
commands to enable these settings.
Font Scale (Font Size -- Testing Dynamic Text)
adb shell settings put system font_scale 0.85
(small)
adb shell settings put system font_scale 1.0
(default)
adb shell settings put system font_scale 1.15
(large)
adb shell settings put system font_scale 1.30
(largest)
adb shell settings put system font_scale 2.0
(sizes like this can only be achieved with custom adb setting, not from ui)
Talkback
disable
adb shell settings put secure enabled_accessibility_services com.android.talkback/com.google.android.marvin.talkback.TalkBackService
enable
adb shell settings put secure enabled_accessibility_services com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService
Color
Properties:
accessibility_display_daltonizer_enabled=1
accessibility_display_daltonizer=11
accessibility_display_daltonizer=12
accessibility_display_daltonizer=13
ADB Commands:
adb shell settings put secure accessibility_display_daltonizer_enabled 1
adb shell settings put secure accessibility_display_daltonizer 0
adb shell settings put secure accessibility_display_daltonizer 11
adb shell settings put secure accessibility_display_daltonizer 12
adb shell settings put secure accessibility_display_daltonizer 13
0 == Monochromatic
11 is for Deuteranomaly (red-green)
12 is for Protanomaly (red-green)
13 is for Tritanomaly (blue-yellow)
Color Inversion
Property: accessibility_display_inversion_enabled=1
ADB Command: adb shell settings put secure accessibility_display_inversion_enabled 1
High Contrast Text
Property: high_text_contrast_enabled=1
ADB Command: adb shell settings put secure high_text_contrast_enabled 1
List Existing Properties
adb shell settings list system
adb shell settings list global
adb shell settings list secure
Also, adb shell getprop
is a great way to expose a lot of other properties you can change with the adb shell setprop
functionality
Show Touches
adb shell settings put system show_touches 1
Pointer Location
adb shell settings put system pointer_location 1
https://developer.android.com/reference/android/provider/Settings
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK