Is there an ADB Shell command that tells me the contents of a TextView?

Solution 1:

You can use uiautomator here. There is a Python package uiautomator that can help:

from uiautomator import device as d

d(resourceId="id/mytextfield").text

Or if you want to do it the more manual way, the screen contents can be dumped to an XML file using adb shell uiautomator dump. Then you can adb pull it locally, where your script can then parse the XML for the text.