limrun-detox-testing — Claude Code skill: what it does, how to install
Configures, runs, and debugs Detox tests on Limrun iOS simulators. Useful when wiring mediator connections over tunnels or injecting the Detox runtime into target apps.
npx skills add limrun-inc/skills --skill limrun-detox-testing -a claude-codeWhat limrun-detox-testing does
The skill coordinates three parts of the test workflow: the local Jest test runner, the detox run-server mediator process, and the client app injected via lim ios launch-app --runtime detox. It enforces an exact execution order. First, start the mediator on port 8099, then establish a detached tunnel with lim ios tunnel, run the tester using npx detox test --no-start, and finally launch the application.
The project requires a .detoxrc configuration targeting the @limrun/detox/driver driver. Because Detox does not pick up session environment variables automatically, your configuration file must map DETOX_SERVER and DETOX_SESSION_ID explicitly. Instance API interactions like taking screenshots rely on additional variables: LIMRUN_IOS_ID, LIMRUN_IOS_API_URL, and LIMRUN_IOS_TOKEN.
Detox does not manage the simulator lifecycle, so instances must be created and deleted separately. An open idle tunnel does not count as simulator activity. The instance inactivity timeout can shut down the simulator between consecutive test runs if the connection remains silent.
What it helps with
- wire the app client to the Detox mediator across destination tunnels
- configure
.detoxrcwith the@limrun/detox/driverdriver - verify UI accessibility identifiers using
lim ios element-tree - troubleshoot out-of-order connections between the tester and mediator
Example prompts for the agent
- Help me configure and run Detox tests on a Limrun iOS simulator.
- Debug a Detox mediator forwarding error during simulator launch.
- Set up a .detoxrc configuration with the Limrun third-party driver.
How to install limrun-detox-testing
1Skills CLI (Vercel)
npx skills add limrun-inc/skills --skill limrun-detox-testing -a claude-code2Manually: put the files in place
~/.claude/skills/limrun-detox-testing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/limrun-detox-testing/
1Skills CLI (Vercel)
npx skills add limrun-inc/skills --skill limrun-detox-testing -a codex2Manually: put the files in place
.agents/skills/limrun-detox-testing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add limrun-inc/skills --skill limrun-detox-testing -a cursor2Manually: put the files in place
.cursor/skills/limrun-detox-testing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install limrun-inc/skills limrun-detox-testing2Manually: put the files in place
.github/skills/limrun-detox-testing/SKILL.md1Skills CLI (Vercel)
npx skills add limrun-inc/skills --skill limrun-detox-testing -a gemini-cli2Platform CLI
gemini skills install https://github.com/limrun-inc/skills --path skills/limrun-detox-testingManually: put the files in place
.devin/skills/limrun-detox-testing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add limrun-inc/skills --skill limrun-detox-testing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about limrun-detox-testing
How to install limrun-detox-testing in Claude Code?
Run npx skills add limrun-inc/skills --skill limrun-detox-testing -a claude-code. Alternatively, place the skill definition file at ~/.claude/skills/limrun-detox-testing/SKILL.md.
What does limrun-detox-testing do?
It guides the setup and debugging of Detox on Limrun iOS simulators, managing the tunnel, the mediator server, and app runtime arguments.
Why does the mediator report Cannot forward the message to the Detox client?
This benign notice occurs when the app launches before the tester connects to the mediator. Starting npx detox test --no-start before launching the app resolves the message.
Source text
SKILL.md · MIT
---
name: limrun-detox-testing
description: Configure, run, or debug Detox on Limrun iOS simulators. Use when attaching the Limrun Detox runtime to an app, wiring Detox mediator connectivity, or validating app/tester connections over destination tunnels.
user-invocable: true
---
# Limrun Detox
Use this for Detox runtime work on Limrun iOS. Keep build concerns separate
unless the user explicitly asks for a native build.
## Components
- Tester: local Node/Jest/Detox process.
- Mediator: `detox run-server`, usually local to the agent machine.
- App client: injected by limulator through `lim ios launch-app --runtime detox`.
## CLI Flow
Check current help before running commands you have not used in this session:
```bash
lim ios tunnel --help
lim ios launch-app --help
```
Run the long-lived mediator, tester, and tunnel from separate terminals.
Before using this quick path, ensure the project's `.detoxrc` reads the session
environment. Detox does not consume these variables automatically:
```js
session: {
server: process.env.DETOX_SERVER || 'ws://localhost:8099',
sessionId: process.env.DETOX_SESSION_ID || 'limrun-detox',
}
```
The complete configuration appears under **Detox Test Setup** below.
Terminal 1:
```bash
npx detox run-server -p 8099 -l verbose
```
Terminal 2:
```bash
lim ios tunnel \
--selector localhost:8099 \
--detach \
--id <ios-id>
DETOX_SERVER_URL="ws://localhost:8099"
```
Terminal 3 starts the tester before the app connects:
```bash
DETOX_SERVER="ws://localhost:8099" \
DETOX_SESSION_ID=<session-id> \
npx detox test --no-start
```
Then relaunch the app from Terminal 2. `--detox-version` is optional when
running from the project with `node_modules/detox`.
```bash
lim ios launch-app <bundle-id> \
--id <ios-id> \
--runtime detox \
--detox-server-url "$DETOX_SERVER_URL" \
--detox-session-id <session-id> \
--detox-version <detox-version>
```
Prefer starting the tester before the app connects, or use the maintained orchestration in [limrun-inc/typescript-sdk `examples/detox-ios`](https://github.com/limrun-inc/typescript-sdk/tree/main/examples/detox-ios), to avoid benign mediator "cannot forward" noise.
If you manually launch the app before `npx detox test --no-start`, that mediator message is expected until the tester connects.
If tunnel start reports an active session, inspect it with `lim ios tunnel status --id <ios-id> --json`. Stop an obsolete session with `lim ios tunnel stop --id <ios-id>`, then start the declared mediator selector again.
An open idle tunnel does not count as instance activity, so it does not prevent
the simulator's inactivity timeout between test runs.
## Detox Test Setup
`npx detox test --no-start` still needs the normal Detox project configuration:
- Pass the Detox config file and configuration name from your project (see [`examples/detox-ios/.detoxrc.cjs` in limrun-inc/typescript-sdk](https://github.com/limrun-inc/typescript-sdk/blob/main/examples/detox-ios/.detoxrc.cjs) for a reference layout).
- Use the Limrun third-party driver: `type: '@limrun/detox/driver'`.
- Keep `DETOX_SERVER` and `DETOX_SESSION_ID` aligned with the mediator and launch command.
- Provide Limrun driver env such as `LIMRUN_IOS_ID`, `LIMRUN_IOS_API_URL`, and `LIMRUN_IOS_TOKEN` when screenshots or driver calls need the instance API.
Use [limrun-inc/typescript-sdk `examples/detox-ios`](https://github.com/limrun-inc/typescript-sdk/tree/main/examples/detox-ios) as the maintained happy path for exact config/env wiring. Use `-l trace` on `detox run-server` only when verbose logs are not enough.
For native SwiftUI apps, a minimal Detox configuration usually looks like:
```js
const server = process.env.DETOX_SERVER || 'ws://localhost:8099';
const sessionId = process.env.DETOX_SESSION_ID || 'limrun-detox';
module.exports = {
testRunner: { args: { $0: 'jest' }, jest: { setupTimeout: 120000 } },
session: {
server,
sessionId,
debugSynchronization: 0,
},
apps: { ios: { type: 'ios.app', binaryPath: 'unused-by-limrun' } },
devices: {
limrun: {
type: '@limrun/detox/driver',
device: { id: process.env.LIMRUN_IOS_ID },
},
},
configurations: {
'ios.limrun': {
device: 'limrun',
app: 'ios',
behavior: { init: { reinstallApp: false }, cleanup: { shutdownDevice: false } },
},
},
};
```
Then launch with `lim ios launch-app <bundle-id> --runtime detox ...` and run `npx detox test --no-start`.
## Validation Signals
- App connected: `detox run-server` logs `role:"app"` and `appConnected:true`.
- Tester connected: the same session reaches `testerConnected:true, appConnected:true`.
- Runtime loaded: the app connects to the mediator after the `--runtime detox` launch.
- UI visible: `lim ios element-tree --id <ios-id>` shows the expected app screen.
## Gotchas
- Do not pass arbitrary env vars, app args, or injectable paths. Use `--runtime detox`.
- `--detox-version` should match the local `detox` package version used by the tester. If omitted, `lim ios launch-app` resolves it from the current working directory; pass it explicitly when running outside the Detox project.
- Unsupported bundled Detox versions should fail with a clear supported-version list.
- `Cannot forward the message to the Detox client` can simply mean the app connected before the tester did.
- For SwiftUI, prefer stable accessibility identifiers, e.g. `.accessibilityIdentifier("greetingText")` with `by.id('greetingText')`; `by.text(...)` can miss labels that appear in `lim ios element-tree`.
- Debug failures by checking `lim ios element-tree --id <ios-id>` first, then mediator logs for app/tester connection state.
- Cleanup manual runs by stopping `detox run-server`, running `lim ios tunnel stop --id <ios-id>`, and deleting the instance with `lim ios delete <ios-id>` (`--id` is not valid for delete).
- This does not make Detox own the iOS lifecycle; prepare or reuse the Limrun instance separately.
© limrun-inc · MIT · limrun-inc/skills