Skip to content

Midscene E2E Tests

Midscene can test apps on your real iPhone through the board. The @midscene/ios-esp32 adapter exposes the board over Midscene Connect, so Midscene’s vision agent runs aiAct, aiAssert and aiQuery tests and writes step-by-step replay reports.

The board captures the screen over AirPlay and taps, swipes and types as a Bluetooth or USB keyboard and mouse. The iPhone stays stock: no Developer Mode, no Xcode signing, no expiring certificates and no WebDriverAgent.

This integration was built by @await-ovo as part of Midscene Test Everything (showcase issue). Thank you!

  1. Set up the board and pair your computer with the CLI guide, then check that you get a screenshot (Node.js 20.19+ and ffmpeg):

    Terminal window
    npx -y esp32agent devices
    npx -y esp32agent screenshot
  2. Start the Midscene Connect service. It connects to the paired board automatically (pass --device <id> or set ESP32AGENT_DEVICE when you have several):

    Terminal window
    npx @midscene/ios-esp32

    It listens on http://127.0.0.1:5820; no token is needed on localhost.

  3. Try it interactively in Midscene Playground:

    Terminal window
    npx @midscene/connect playground --url http://127.0.0.1:5820
  4. Write a test with the Midscene SDK:

    import { agentOverConnectProtocol } from '@midscene/connect';
    const agent = await agentOverConnectProtocol({ url: 'http://127.0.0.1:5820' });
    try {
    await agent.aiAct('Open Settings and tap General');
    await agent.aiAssert('The General settings page is visible');
    } finally {
    await agent.destroy();
    }

Midscene uses its own model configuration for planning and locating; see the Midscene model docs.

  • Text input: tap a field first; the adapter types printable ASCII. For other text, tap the on-screen keyboard.
  • Stale frames: if Screen Mirroring drops, the adapter retries for 10 seconds by default (--stale-retry-ms changes it). Check that Control Center → Screen Mirroring → ESP32 Agent is on.
  • More detail and troubleshooting: the @midscene/ios-esp32 README.

Manina AI is not affiliated with ByteDance or the Midscene project.