Test with the TalkBack Screen Reader
TalkBack is Android's built-in screen reader. Enabling it on an Appetize device lets you verify that your app is accessible.
TalkBack is preinstalled on Appetize Android devices but disabled by default. You enable it for a session by running a few adb commands and turning on audio so you can hear it.
TalkBack registers itself as an accessibility service. Appetize's automation helper (io.appetize.automations) is also an accessibility service, so it must be uninstalled before TalkBack can take over. This disables the automation engine (findElement, playAction, recorded actions) for the rest of the session. Start a fresh session to get automation back.
Prerequisites
An Android device. TalkBack and
adbcommands are Android-only.Audio enabled on the session, so you can hear TalkBack speak.
Enable TalkBack
Run the following adb shell commands on the device, in order:
# Remove the Appetize automation helper (it conflicts with TalkBack)
adb shell pm uninstall io.appetize.automations
# Grant TalkBack the runtime permissions it needs
adb shell pm grant com.google.android.marvin.talkback android.permission.POST_NOTIFICATIONS
adb shell pm grant com.google.android.marvin.talkback android.permission.READ_PHONE_STATE
# Set TalkBack as the active accessibility service
adb shell settings put secure enabled_accessibility_services \
com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackServiceRunning the commands on Appetize
You can run these in three ways, depending on your workflow.
With the JavaScript SDK
Use session.adbShellCommand(). It runs the part after adb shell. Enable audio in the session config so TalkBack is audible:
At session start
Use adbShellCommand when you want TalkBack enabled as soon as the session starts. Since adbShellCommand accepts one shell string, chain the commands together:
With an ADB tunnel
Use an ADB tunnel when you want to run standard adb shell commands from your machine or from Android Studio.
Start the session with
audio=true&enableAdb=true.Connect to the device with the generated ADB command.
Run the commands from the Enable TalkBack section with
adb shell ....
This is useful when you already debug sessions through ADB and want the same workflow here.
Live sample
Hear audio output combined with the TalkBack screen reader:
Last updated