Why idb Matters
Without idb, Preflight falls back to Swift CGEvent injection: it maps simulator screen coordinates to macOS screen coordinates and synthesizes mouse events. This works, but it briefly moves your cursor on every tap — disruptive when you’re working alongside the AI agent. With idb, touch events go directly to the simulator process. Your cursor stays wherever you left it.Touch Injection Pipeline
PREFLIGHT_IDB_PATHenvironment variable (if set)which idb— respects thePATHin your MCP config- Common install locations (see below)
Install idb
Finding Your idb Path
pip3 installsidb into a Python-versioned directory that isn’t always on the system PATH. Run:
which returns nothing, check the common pip3 install locations directly:
| Path | Install method |
|---|---|
/opt/homebrew/bin/idb | Homebrew (Apple Silicon) |
/usr/local/bin/idb | Homebrew (Intel) |
~/Library/Python/3.9/bin/idb | pip3 (Python 3.9) |
~/Library/Python/3.10/bin/idb | pip3 (Python 3.10) |
~/Library/Python/3.11/bin/idb | pip3 (Python 3.11) |
~/Library/Python/3.12/bin/idb | pip3 (Python 3.12) |
~/Library/Python/3.13/bin/idb | pip3 (Python 3.13) |
~/.local/bin/idb | pip3 (user install) |
PATH or PREFLIGHT_IDB_PATH.
Adding idb to PATH in Your MCP Config
MCP clients launch the server with a minimal environment. You need to explicitly include the directory containingidb in the PATH env var.
Using PREFLIGHT_IDB_PATH
If you’d rather not modifyPATH, set PREFLIGHT_IDB_PATH to the absolute path of the idb binary:
Verifying idb Is Detected
The easiest way to confirm idb is working is to check the tool descriptions returned to your MCP client. When idb is active, interaction tools show[cursor-free] in their description. When falling back to CGEvent, they show [CGEvent fallback].
You can also set LOG_LEVEL=debug to see exactly what Preflight finds at startup:
CGEvent Fallback Behavior
When idb is not available, Preflight uses a compiled Swift binary (dist/mouse-events) to inject touch via CGEvent:
- It maps simulator screen coordinates to macOS display coordinates using the simulator window geometry
- It synthesizes
mouseDownandmouseUpevents at the computed screen position - Your Mac cursor moves to that position briefly, then stays there
The Swift binary (
dist/mouse-events) is compiled during npm run build alongside the TypeScript output. If you see errors about the binary missing, run npm run build again — it requires swiftc from Xcode Command Line Tools.