Metadata-Version: 2.4
Name: pilotdroid
Version: 0.6.1.post1
Summary: Device-side UiAutomation agent — uiautomator2-compatible Python client (connect/click/query/scroll/stream)
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: msgpack>=1.0

# pilotdroid (python)

uiautomator2-compatible Python client over the pilotdroid device agent.
Persistent socket, no per-op uiautomator server — ~10x device-op latency vs
stock u2 (see repo `spike/e2e/RESULTS-*.md`).

mcp-name: io.github.mofanx/pilotdroid

## Install

```bash
pip install ./python            # local checkout
pip install msgpack             # sole runtime dep (auto-installed by pip)
```

## Deploy agent + connect

```bash
./agent/scripts/deploy-agent.sh <serial>   # pushes jar, starts app_process agent
adb forward tcp:17932 localabstract:pilotdroid_agent
```

```python
import pilotdroid
d = pilotdroid.connect(port=17932, serial="ba0d072d")

d(text="OK").click()
d(className="android.widget.TextView", index=1).exists   # property, u2-style
d(scrollable=True).scroll.forward()
d.app_start("com.android.settings"); d.app_current()
d.set_text("你好")        # ACTION_SET_TEXT — unicode works, no IME needed
d.screenshot("shot.jpg", scale=0.5)
```

## Supported selector keys

`text, resourceId, description, className, packageName, scrollable, index`
(AND semantics; `index` = nth match). `xpath` is **not** supported
(u2 xpath is an optional plugin, not core).

See `compat/u2shim.py` docstring for the full covered API surface.
