How to Get Current Activity’s Layout in Android

Jerry An
1 min readJan 20, 2024

adb shell uiautomator dump

This command generates an XML dump of the current UI hierarchy. Here’s a simple example dumped by it

<?xml version="1.0" encoding="UTF-8"?>
<hierarchy rotation="0">
<node index="0" text="" resource-id=""…

--

--