К основному содержанию
скилл CX Codex

limrun-detox-testing — скилл для Claude Code: что делает

Помогает настроить, запустить и отладить тесты Detox на удалённых симуляторах Limrun iOS. Пригодится при пробросе туннелей к медиатору и инжекции рантайма в приложение.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add limrun-inc/skills --skill limrun-detox-testing -a claude-code
Открыть на GitHub

Что делает limrun-detox-testing

Скилл координирует работу трёх компонентов: локального тестера Jest/Detox, процесса-медиатора detox run-server и клиентского приложения. Запуск клиента выполняется командой lim ios launch-app --runtime detox. Инструкции задают чёткую последовательность действий: сначала стартует медиатор на порту 8099, затем поднимается фоновый туннель lim ios tunnel, следом запускается тестер через npx detox test --no-start, и только потом приложение подключается к сессии.

Для работы требуется настроить конфигурацию .detoxrc с драйвером @limrun/detox/driver. Сам Detox не подхватывает переменные окружения сессии автоматически, поэтому в конфигурационном файле необходимо явно прописать чтение DETOX_SERVER и DETOX_SESSION_ID. Если вызовы драйвера или снятие скриншотов обращаются к API инстанса, понадобятся переменные LIMRUN_IOS_ID, LIMRUN_IOS_API_URL и LIMRUN_IOS_TOKEN.

Скилл не берёт на себя управление жизненным циклом симулятора: создавать и удалять инстанс Limrun нужно отдельно. Учтите, что открытый простаивающий туннель не считается активностью инстанса. Из-за этого удалённый симулятор может отключиться по таймауту прямо между последовательными запусками тестов.

Какие задачи решает

  • связать клиентское приложение с медиатором Detox через сетевой туннель
  • настроить конфигурационный файл .detoxrc под драйвер @limrun/detox/driver
  • проверить дерево доступности интерфейса через команду lim ios element-tree
  • устранить рассинхронизацию при подключении тестера и приложения к сессии

Примеры запросов агенту

  • Помоги настроить и запустить тесты Detox на симуляторе Limrun iOS
  • Медиатор Detox выдаёт ошибку forwarding message, проверь порядок запуска сессии
  • Сконфигурируй .detoxrc для драйвера limrun и подними туннель к порту 8099

Как установить limrun-detox-testing

1Через Skills CLI (Vercel)

npx skills add limrun-inc/skills --skill limrun-detox-testing -a claude-code

2Вручную: положить файлы

~/.claude/skills/limrun-detox-testing/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/limrun-detox-testing/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о limrun-detox-testing

Как установить limrun-detox-testing в Claude Code?

Выполните команду npx skills add limrun-inc/skills --skill limrun-detox-testing -a claude-code. Либо вручную скопируйте файл манифеста в ~/.claude/skills/limrun-detox-testing/SKILL.md.

Что делает скилл limrun-detox-testing?

Он помогает настроить сетевую связку между Jest, медиатором Detox и удалённым симулятором Limrun iOS. Скилл содержит инструкции по пробросу туннелей, запуску рантайма и отладке подключений.

Почему медиатор пишет Cannot forward the message to the Detox client?

Это штатное сервисное сообщение, которое появляется, если приложение запустилось раньше тестера npx detox test --no-start. Ошибка пропадает сама, как только тестер подключится к той же сессии.

Исходный текст

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

Похожие скиллы

Всё по теме «Тесты и QA» →
mobile-app-testing aj-geddes Задаёт правила тестирования приложений для iOS и Android. Помогает писать юнит-, UI- и интеграционные тесты с Jest, Detox, Espresso и XCTest. CX Codex +1 823установок capacitor-testing Cap-go Скилл разбирает, каким слоем тестировать Capacitor-приложение: Vitest с моками плагинов, Playwright, Appium и нативные тесты. CX Codex +1 1 300установок jest-react-testing manutej Скилл для тестирования React-компонентов и хуков через Jest и React Testing Library: конфигурация, моки, асинхронные сценарии. CX Codex +1 1 200установок unit-testing kindlmann Скилл для написания юнит-тестов: подсказывает, какие тест-двойники брать, как настроить порог покрытия и как проверить тесты мутационным тестированием. CX Codex +1 1 100установок testing-best-practices agent-skills Набор правил по юнит- и интеграционным тестам и TDD: 34 правила в 7 категориях на TypeScript с Jest и Vitest. Пригодится, когда пишете тесты или разбираете чужие. CX Codex +1 899установок code-testing dotnet Скилл для генерации, починки и усиления тестов: xUnit, MSTest, NUnit, pytest, Vitest/Jest, Go. Точечную работу делает сам, широкую отдаёт субагенту test-engineer. CX Codex +1 863установок

Из того же набора6

limrun-xcode-bazel Собирает Bazel-проекты для Apple на удалённых Mac-воркерах Limrun и ставит приложение на удалённый симулятор. Нужен, если проект уже работает на lim xcode rbe. CX Codex +1 43 100установок limrun-expo-development Готовит и запускает Expo и React Native приложения на Limrun: dev-client сборка, туннель Metro, правки JS и TS без повторных нативных пересборок. CX Codex +1 43 100установок limrun-xcode Собирает и тестирует iOS-проекты на удалённом Xcode через lim xcode build, run и test — с Linux, Windows или из контейнера. CX Codex +1 43 100установок limrun-gradle Собирает Android-приложения в удалённой песочнице с помощью команды lim gradle build. Помогает получить APK или подписанный AAB без локального Android SDK и Gradle. CX Codex +1 40 000установок limrun-android-emulator Скилл управляет приложением на облачном Android-эмуляторе Limrun: ставит APK, тапает, снимает скриншоты и читает логи. Пригодится после сборки, когда нужно посмотреть, как ведёт себя приложение. CX Codex +1 38 700установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой