7

I've tried the command adb shell settings put secure enabled_accessibility_services com.android.talkback/com.google.android.marvin.talkback.TalkBackService to enable talkback from adb shell. It's toggling the ui button which signifies the status of talkback, but talkback is not actually getting enabled. I am trying to enable talkback programmatically for android 6.0. Is there any other way thorough which I can enable it?

3 Answers3

24

Commands to toggle 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

Kudos to @zeh

Estevão Lucas
  • 4,440
  • 34
  • 37
2

For convenience, I use a shell script to toggle this setting.

output=$(adb shell settings get secure enabled_accessibility_services)

if [[ "$output" == "com.android.talkback/com.google.android.marvin.talkback.TalkBackService" ]]; then
  adb shell settings put secure enabled_accessibility_services com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService
else
  adb shell settings put secure enabled_accessibility_services com.android.talkback/com.google.android.marvin.talkback.TalkBackService
fi
Simon Featherstone
  • 1,716
  • 23
  • 40
0

Are you running this alongside any other accessibility services or UI Automation (which utilizes the accessibility APIs)? Accessibility services are only allowed to run one at a time, and attempting otherwise will cause exceptions all over the place. Check LogCat and see if TalkBack is attempting to start up, but throwing exceptions when doing so.

MobA11y
  • 18,425
  • 3
  • 49
  • 76