How to get id of an element in android?

I locate an element using a locator and I want to get the id of the element in android. How do I get it?

use appium inspector or uiautomatorviewer

In Python you’d do something like.

el = self.driver.find_element_by_xpath(your_xpath)
id = el.id