Appduct by Callstack. Your app is an MCP server now: your agent calls its functions over MCP, on iOS, Android, React Native, Flutter and web. # Device e2e suite Drives a playground app on an iOS simulator or Android emulator. agent-device presses and reads the screen; `appduct/client`, the CLI and the MCP server assert on the daemon side. One file per case, run serially against one device. The playgrounds follow the [playground contract](../docs/internal/playground-contract.md); the cases read only its ids. ## Requirements Node 24 and pnpm 11. Install agent-device and its prerequisites (Xcode, or the Android SDK with `ANDROID_HOME` set and an emulator already running), `flutter` on `PATH` for the Flutter targets, and `xcodegen` for `native-ios`. An Expo target starts its own Metro on port 8081 and refuses to run when something already listens there. ## Getting started From the repository root, install dependencies and run a target: ```bash pnpm install --frozen-lockfile pnpm build # the suite runs this checkout's CLI APPDUCT_E2E_TARGET=expo-ios pnpm e2e:device # build, install, run every case that applies APPDUCT_E2E_TARGET=expo-ios pnpm e2e:device -- cases/app-killed.device.test.ts # one case ``` ## Choose a target Set `APPDUCT_E2E_TARGET` to `expo-ios`, `expo-android`, `native-ios`, `native-android`, `flutter-ios` or `flutter-android`. ## Run options | Variable | Meaning | | --- | --- | | `APPDUCT_E2E_TARGET` | Required. `expo-ios`, `expo-android`, `native-ios`, `native-android`, `flutter-ios` or `flutter-android`. | | `APPDUCT_E2E_DEVICE` | Simulator udid or emulator serial. Default: the first iPhone on the newest iOS runtime, or the one running emulator. | | `APPDUCT_E2E_SKIP_BUILD=1` | Install the last build instead of building again. | | `APPDUCT_E2E_RELEASE=1` | Also run `release-opt-in`, which builds the opted-in release variant (`expo-android`, `flutter-android`). | Each case file gets its own daemon in a fresh state dir. Build, Metro and `flutter run` output lands in `e2e-device/.artifacts/`. ## Cases | File | Proves | Targets | | --- | --- | --- | | `cold-link` | a link launches the stopped app into an active session that reports the real device | all | | `warm-link` | a second link replaces the session and suspends the first; the app stays on its screen | all; the screen check skips on Expo (#235) | | `tools-round-trip` | the five tools match the contract, and the counter on screen follows them | all | | `ui-event` | a press on the ping button reaches `waitForEvent` | all | | `status-deep-link` | `:///status` opens Status and leaves the session active | all but `native-android` | | `background-resume` | home suspends as `app_backgrounded`, and reopening resumes the same session | all | | `js-reload` | a Metro reload or hot restart resumes the same session with fresh state | Expo, Flutter | | `reload-in-flight` | a call running during the reload fails at once with `session_suspended` | Expo | | `app-killed` | a killed app relaunched without a link stays idle; a new link connects | all | | `release-opt-in` | an opted-in release build connects | `expo-android`, `flutter-android`; native in #247 | ## Add a case - No fixed sleeps. Wait on a condition with a deadline (`until`, `waitForText`, `waitForSessionState`). - Prove a negative ("stays idle") only after a positive state shows on screen. - Always pass the session id. Suspended sessions from earlier in the file stay listed for 600 s. - A case that passes only on a rerun is a flake. Report it; never add a retry. ## Learn more - [Playground contract](../docs/internal/playground-contract.md) - [CLI test client](https://callstackincubator.github.io/appduct/guides/cli/#drive-the-app-from-a-test-suite) ## Made with ❤️ at Callstack `appduct` is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Callstack][callstack-readme-with-love] is a group of React and React Native geeks, contact us at [hello@callstack.com](mailto:hello@callstack.com) if you need any help with these or just want to say hi! Like the project? ⚛️ [Join the team](https://callstack.com/careers/?utm_campaign=Senior_RN&utm_source=github&utm_medium=readme) who does amazing stuff for clients and drives React Native Open Source! 🔥 [callstack-readme-with-love]: https://callstack.com/?utm_source=github.com&utm_medium=referral&utm_campaign=appduct&utm_term=readme-with-love