import uiautomator2 as u2 # pip install findit d = u2.connect() d.image.click("../Template/X1.jpg")