Вы можете использовать Appium инспектор, чтобы получить результат XML: Appium
Appium является открытой рамкой автоматизации источника. Он также предоставляет инструменты для получения иерархии пользовательского интерфейса приложения.
Следуйте инструкциям и запустите инспектора Appium. Заполните требуемую информацию, такую как тип устройства и UDID. Скриншот: Appium Inspector
Используйте графический интерфейс Appium и в правом нижнем углу есть кнопка «Копировать XML». Нажмите кнопку обновления, чтобы получить иерархию пользовательского интерфейса текущего экрана.
Вот результат использования калькулятора.
<?xml version="1.0" encoding="UTF-8"?>
<AppiumAUT>
<UIAApplication name="Calculator" label="Calculator" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0" x="0" y="20" width="320" height="548">
<UIAWindow name="" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0" x="0" y="0" width="320" height="568">
<UIAStaticText name="Result" label="Result" value="0" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/0" x="0" y="0" width="320" height="168">
</UIAStaticText>
<UIAButton name="all clear" label="all clear" value="all clear" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/1" x="1.5" y="169.5" width="78.5" height="79">
</UIAButton>
<UIAButton name="plus, minus" label="plus, minus" value="plus, minus" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/2" x="80.5" y="169.5" width="79" height="79">
</UIAButton>
<UIAButton name="percent" label="percent" value="percent" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/3" x="160" y="169.5" width="79" height="79">
</UIAButton>
<UIAButton name="divide" label="divide" value="divide" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/4" x="239.5" y="169.5" width="79" height="79">
</UIAButton>
<UIAButton name="7" label="7" value="7" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/5" x="1.5" y="249" width="78.5" height="79">
</UIAButton>
<UIAButton name="8" label="8" value="8" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/6" x="80.5" y="249" width="79" height="79">
</UIAButton>
<UIAButton name="9" label="9" value="9" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/7" x="160" y="249" width="79" height="79">
</UIAButton>
<UIAButton name="multiply" label="multiply" value="multiply" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/8" x="239.5" y="249" width="79" height="79">
</UIAButton>
<UIAButton name="4" label="4" value="4" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/9" x="1.5" y="328.5" width="78.5" height="79">
</UIAButton>
<UIAButton name="5" label="5" value="5" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/10" x="80.5" y="328.5" width="79" height="79">
</UIAButton>
<UIAButton name="6" label="6" value="6" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/11" x="160" y="328.5" width="79" height="79">
</UIAButton>
<UIAButton name="subtract" label="subtract" value="subtract" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/12" x="239.5" y="328.5" width="79" height="79">
</UIAButton>
<UIAButton name="1" label="1" value="1" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/13" x="1.5" y="408" width="78.5" height="79">
</UIAButton>
<UIAButton name="2" label="2" value="2" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/14" x="80.5" y="408" width="79" height="79">
</UIAButton>
<UIAButton name="3" label="3" value="3" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/15" x="160" y="408" width="79" height="79">
</UIAButton>
<UIAButton name="add" label="add" value="add" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/16" x="239.5" y="408" width="79" height="79">
</UIAButton>
<UIAButton name="0" label="0" value="0" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/17" x="1.5" y="487.5" width="157" height="79">
</UIAButton>
<UIAButton name="decimal" label="decimal" value="decimal" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/18" x="160" y="487.5" width="79" height="79">
</UIAButton>
<UIAButton name="equals" label="equals" value="equals" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/0/19" x="239.5" y="487.5" width="79" height="79">
</UIAButton>
</UIAWindow>
<UIAWindow name="" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/1" x="0" y="0" width="320" height="568">
<UIAStatusBar name="" label="" value="" dom="" enabled="true" valid="true" visible="true" hint="" path="/0/1/0" x="0" y="0" width="320" height="20">
<UIAElement name="2 of 5 bars, signal strength" label="2 of 5 bars, signal strength" value="" dom="" enabled="true" valid="true" visible="true" hint="Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top" path="/0/1/0/0" x="6" y="0" width="35" height="20">
</UIAElement>
<UIAElement name="T-Mobile network" label="T-Mobile network" value="" dom="" enabled="true" valid="true" visible="true" hint="Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top" path="/0/1/0/1" x="44" y="0" width="48" height="20">
</UIAElement>
<UIAElement name="3 of 3 Wi-Fi bars" label="3 of 3 Wi-Fi bars" value="FireEye" dom="" enabled="true" valid="true" visible="true" hint="Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top" path="/0/1/0/2" x="97" y="0" width="13" height="20">
</UIAElement>
<UIAElement name="10:48 AM" label="10:48 AM" value="" dom="" enabled="true" valid="true" visible="true" hint="Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top" path="/0/1/0/3" x="134" y="0" width="52" height="20">
</UIAElement>
<UIAElement name="95% battery power, Charging" label="95% battery power, Charging" value="" dom="" enabled="true" valid="true" visible="true" hint="Swipe down with three fingers to reveal the notification center., Swipe up with three fingers to reveal the control center, Double-tap to scroll to top" path="/0/1/0/4" x="282" y="0" width="33" height="20">
</UIAElement>
</UIAStatusBar>
</UIAWindow>
</UIAApplication>
</AppiumAUT>
Хотя эта ссылка может ответить на вопрос, лучше включить основные части ответа здесь и предоставить ссылку для справки. Ответные ссылки могут стать недействительными, если связанная страница изменится. – LittleBobbyTables
Спасибо за ваш комментарий. Я отредактировал свой ответ. Пожалуйста, предложите, если я могу что-то улучшить. – Song