feat(shake): add a shake command for iOS simulators and Android emulators
Merged
FO
7d ago+834+834+012345678901234567890123456789-16-16-01234567890123456789
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.SimulatorShakethroughsimctl 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 hostedmacos-26-arm64image (iOS 26.5) the rawsimctlcall shook the app (run), but three agent-device attempts timed out: twice insideopen, once inshake's 10 ssimctlcall. - The physical iPhone refusal is unit-tested only.
- CI has not run on this head.
🤖 Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.