Files
Ignacy Łątka 1110b24642 Merge origin/main: adopt per-tool dirs + dispatchByPlatform from #164
Migrates this branch's Android implementations into main's new per-tool
directory layout (`tools/<name>/index.ts` + `platforms/{ios,android}.ts`)
and replaces the bespoke `classifyDevice` async dispatch with main's
`dispatchByPlatform` helper.

Per-platform Android impls (previously inline `classifyDevice` branches in
each tool's single-file index):

- gesture-tap, gesture-swipe, gesture-custom, gesture-pinch, gesture-rotate,
  screenshot, button, keyboard, rotate — all use the same `simulator-server`
  channel as iOS (`simulator-server android --id <serial>` accepts identical
  payloads), so each `platforms/android.ts` mirrors the iOS handler. No
  `requires: ["adb"]` on these branches because no `adb` shell-out happens.
- launch-app, restart-app, open-url, reinstall-app — actual `adb` shell-outs
  (`am start -W`, `am force-stop`, `am start -a VIEW`, `adb install -r`).
  Each Android branch declares `requires: ["adb"]`.
- describe — `uiautomator dump` parsed by the existing `uiautomator-parser`,
  returning the same `DescribeNode` shape as the iOS AX adapter.

Capability flips: every cross-platform tool now declares `android: { emulator,
device, unknown }` so the HTTP capability gate routes Android udids to the new
handlers instead of 400-ing.

`launch-app` and `restart-app` make `services()` platform-aware via
`classifyDevice(udid)` so the iOS-only `nativeDevtools` blueprint isn't
spun up for Android targets.

Dropped: per-tool dispatch tests (`*-dispatch.test.ts`) and
`classify-device.test.ts` — the old async-classify + inline-branch
architecture they exercised no longer exists. The new layer is covered by
main's `cross-platform-tool.test.ts`, `device-info.test.ts`, and
`capability.test.ts`.

Setup-registry takes main's per-tool import paths but keeps this branch's
`list-devices` / `boot-device` (the rename main flagged as deferred).

Tool-server: 507 tests pass.
2026-04-28 15:59:37 +02:00
..