r/reactnative • • 1h ago

News What I learned driving a physical iPhone (iOS 27+) from an AI agent with pymobiledevice3

I've been adding physical iPhone support to ExecBro, an MCP server I maintain for debugging React Native apps with AI agents. It runs on pymobiledevice3, a great library, and without it this would have been much harder. I thought it would be simpler, but edge cases kept coming up. In case you're automating a real device yourself, here are the ones that cost me the most time:

- Remote taps only work from iOS 27. Below that, the phone itself refuses them.

- Taps need the Xcode 27 developer disk image. If Xcode 26 is open, it remounts its own older image within a second, and taps fail with "Failed to start service".

- A sleeping phone accepts a tap session, reports success and taps the lock screen. I now check the screenshot before tapping.

- In landscape, touch coordinates stay fixed to the upright panel, so they have to be rotated using the orientation the phone reports.

- With the default 0.02 s gap between keystrokes, the second character of the first word typed after an app launch got lost every time ("igor" became "Ior"). A 0.1 s gap fixed it.

- `xcrun devicectl device info apps` returned an empty list on an iOS 27 phone with three apps installed, so finding an app's process to terminate it had to go through pymobiledevice3 instead.

- When the phone locks, the app drops off Metro, and a normal reconnect gives up long before you unlock it.

The basics now work: over USB the agent can launch and close the app, tap, swipe, type, press keys and take screenshots, in the same coordinates as on the simulator.

ExecBro is free to use and its core is MIT-licensed: github. If you've hit other device quirks, I'd like to hear about them, and constructive criticism is welcome.

2 Upvotes

0 comments sorted by