feat(shake): add a shake command for iOS simulators and Android emulators

Merged
FO
7d ago
+834-16

Summary

Adds a shake command to the CLI, Node client and MCP. e2e needs it for device.shake() (e2e-inc/e2e#1855), where it was asked to land here first.

  • iOS simulator: posts com.apple.UIKit.SimulatorShake through simctl spawn <udid> notifyutil -p, as Device > Shake does. It carries no accelerometer data, so CoreMotion detectors don't see it.
  • Android emulator: ten ±2 g accelerometer swings through the emulator console, then the reading it found.
  • Physical devices, Android TV, tvOS, macOS, web, Linux and remote providers refuse before dispatch.
agent-device shake
await client.command.shake();

54 files. The Android failure reasons come from a typed table (R89). Scope expansion: the session-journal summaries of argumentless system commands now come from one table, which keeps Fallow complexity under the threshold.

Validation

Tested c22b8c1ec on de36d03b7 (rebased onto main), with the branch-built CLI.

  • pnpm check:affected --run --head c22b8c1ec: 43 checks passed, exactCommit: true (Linux).
  • Android emulator, API 35, at af6d39aca (one docs sentence and a rebase since): three shakes moved a shake-detecting app's counter 0→1→2→3; the rest reading was unchanged afterwards.

Recorded at 0ab11ff92, not rerun:

  • Pixel 10a, Android 17: refused with unsupported-device-kind, dispatched: no.
  • iOS 26.2 simulator on a GitHub-hosted Intel Mac: an app counting motionEnded(.motionShake) went 0→1→2→3 (job).

Risks:

  • Apple silicon is not shown end to end (runs at 0ab11ff92). On the hosted macos-26-arm64 image (iOS 26.5) the raw simctl call shook the app (run), but three agent-device attempts timed out: twice inside open, once in shake's 10 s simctl call.
  • The physical iPhone refusal is unit-tested only.
  • CI has not run on this head.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.