Urgent.News

What's breaking now, across hundreds of outlets.

AI

How I got a phone screen down to 59 tokens and 13ms for AI agents (without screenshots or an installed app)

Scroll a long list on Android and something sneaky happens behind the glass. The view holding "Row 13" does not scroll off the top and vanish. Android peels off its label and hands the exact same node ID to "Row 29" down at the bottom. An AI agent tracking that ID will happily tap sixteen rows off, and Android will return a polite ok . Most mobile-agent headaches look like that. Reading an…

Phonedriver is a tool designed to streamline interactions with mobile devices, reducing the amount of data sent between the AI agent and the device. It achieves this by minimizing the XML output from adb shell uiautomator dump from 25KB to just 461 bytes. This is accomplished through several systems tricks, such as dropping invisible and off-screen nodes, hoisting child TextView labels onto clickable wrapper layouts, collapsing single-child decorative containers, and rendering the on-screen keyboard as a single keyboard line.

To avoid the recycled-row bug, phonedriver only follows a platform node ID when the role matches and either the label is untouched or the bounds have drifted less than 8 points. This ensures that the element references stay accurate even during scrolls. Every tap triggers a fresh tree resolution, allowing the model to only receive what has changed, rather than re-reading the entire phone on every turn.

Phonedriver can be used with MCP (Claude Code, Codex, Cursor, VS Code, Gemini CLI) or as a plain CLI. It supports both Android and iOS, with a Rust implementation that is open-source under AGPL-3.0 with zero telemetry. The tool was developed to address the challenges of mobile-agent headaches, such as reading an accessibility tree fast, keeping element references honest across scrolls, and determining when a screen has stopped moving without relying on hardcoded sleeps.

The tool's performance is quite impressive. For example, on an API 37 emulator, the plain adb screen read took 12.7ms, while phonedriver achieved a screen read time of just 12.7ms. On a real HONOR X8 (Android 13), phonedriver's screen read time was 78.5ms compared to 2,507ms for adb's uiautomator dump. Additionally, phonedriver's type-and-check operation took 158ms, whereas adb's took 3,638ms.

The tool also handles real Android bugs like stale caches and unbinding TalkBack, ensuring a smooth and efficient experience for developers.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in AI

3,954 of 4,000 replies right, 4,000 of 4,000 states exact: a host-side layer on Gemini 3.8 Flash, checkable in seconds

On one job of 4,000 requests, Gemini 3.8 Flash's own replies were exactly right 3,954 times (98.85 percent). The state the host held was exactly right on all 4,000 steps. The model was not changed.

  • Gemini 3.8 Flash model achieved 98.85% accuracy in 4,000 requests
  • AXI layer implemented on host side to address 46 incorrect replies
  • 4,000-step results recalculated in seconds without key

Google DeepMind Opens Gemini 4 Carbon for Long-Horizon Agentic Reasoning and Cybersecurity

Google DeepMind has officially released Gemini 4 Carbon, making its highest-performing artificial intelligence model available to developers, enterprise organizations, scientists, and consumers.

  • Google DeepMind launches Gemini 4 Carbon for complex tasks
  • Carbon priced at $2 input and $10 output per million tokens
  • Model excels in agentic workflows, cybersecurity, and verification

More from Tuesday 24 November →