Skip to content

uiautomator2 Plugin

uiautomator2-manina adds plain-language element finding to uiautomator2. It takes a screenshot with d.screenshot(), asks Manina-4B-Lite where the element is, and taps it with d.click(x, y).

m = Manina(d)
m.click("blue Login button")

Selectors (text, resourceId, description, XPath) only reach what the app exposes in its view hierarchy. On a real phone we found four kinds of targets they miss:

  • Icon-only buttons with no text, content-desc, resource-id or Flutter semantics label.
  • Links inside a sentence, such as “I agree to the User Agreement and Privacy Policy”: one TextView, so a selector taps its middle and can open the wrong page.
  • Merged WebView nodes: a link and its header become one node.
  • Canvases and charts: the whole chart or game is one node.

Where a selector already works, keep using it: it is faster and free.

  1. Install:

    Terminal window
    pip install uiautomator2-manina
  2. Create an API key at manina.ai/account/api-keys (new accounts get $1 of free credit):

    Terminal window
    export MANINA_API_KEY=...
  3. Use it:

    import uiautomator2 as u2
    from uiautomator2_manina import Manina
    d = u2.connect()
    m = Manina(d)
    m.click("Settings app icon")
    m.click("About phone", timeout=5) # wait up to 5 s
    if m.exists("Allow button in the permission dialog"):
    m.click("Allow button in the permission dialog")
    hit = m.locate("search field at the top") # Hit or None

locate, wait, exists and click are the whole API; see the README for every option. Each call costs one locate call ($0.30 per 1,000).

Redmi Note 11 5G (Android 13), 2026-12-06, 16 targets checked on the next screen. Full report with every screenshot: test report.

Right Wrong Impossible
Selector from d.dump_hierarchy() 4 2 10
Manina by description 16 0 0
  • The two wrong selector taps: a User Agreement link inside a sentence opened the Privacy Policy; a WebView link merged with its header was tapped in the middle.
  • Speed: median 0.8 s per tap (screenshot 0.3 s, locate round trip 0.5 s, model 0.1 s).
  • Where it does not help: text and tabs in Flutter apps and well-labelled native screens (27 of 28 system-app targets were reachable by a selector).

Manina AI is not affiliated with the uiautomator2 project.