This is a tiny binary that parses the output of Android's uiautomator dump command. It's useful for extracting information from the XML file generated by the command, such as the bounds of a specific node, the text of a node, etc.
uidump-parser --file <xml_file> [OPTIONS]
[OPTIONS]
--file, -f <xml_file> : Path to the XML file to parse (required)
--resource-id, -r <id> : Search for a node with the given resource-id
--class, -c <class_name> : Search for a node with the given class name
--text, -t <text_value> : Search for a node with the given text value
--filter-attribute, -F <attr=val>: Filter by any attribute dynamically (e.g., package, content-desc)
--print-only, -p <attribute> : Print only the specified attribute for matched nodes
--bounds, -b : Print bounds for matched nodes
--debug, -d : Enable debug mode for verbose output
--help, -h : Show this help message and exit
$ adb shell uiautomator dump /sdcard/window_dump.xml
$ adb pull /sdcard/window_dump.xml .
$ adb shell rm /sdcard/window_dump.xml
$ ./uidump-parser ./window_dump.xml --class "android.widget.TextView"
r0rt1z2@r0rt1z2-pc:~/uidumper-parser$ ./libs/linux-x86_64/uidump-parser --file window_dump.xml --class "android.widget.TextView"
Node: node
index: 0
text: Registrarse
resource-id: com.grindrapp.android:id/fragment_login_create_account_button
class: android.widget.TextView
package: com.lbe.parallel.intl
content-desc:
checkable: false
checked: false
clickable: true
enabled: true
focusable: true
focused: false
scrollable: false
...
$ ./uidump-parser ./window_dump.xml --resource-id "com.grindrapp.android:id/fragment_login_create_account_button" --print-only bounds
bounds: [762,102][1080,253]
$ # You can always use the --debug flag to get more information
$ wget https://dl.google.com/android/repository/android-ndk-r27b-linux.zip
$ unzip android-ndk-r27b-linux.zip
$ export ANDROID_NDK_HOME=$(pwd)/android-ndk-r27b
$ export PATH=$ANDROID_NDK_HOME:$PATH
$ make
This project is distributed under the GPL-3.0 License. For more information, simply refer to the LICENSE file.
Please note that the project also uses @leethomason's tinyxml2 library, which is distributed under the zlib License.