Skip to content

feat: simulate_event.py — memory warning / background / battery #56

Description

@conorluddy

Problem

Memory warnings, background transitions, and low-battery code paths are skipped in QA because manual repro is tedious. A one-liner trigger unlocks rare-state testing.

Sketch

python scripts/simulate_event.py --memory-warning
python scripts/simulate_event.py --background --bundle-id com.example.app
python scripts/simulate_event.py --foreground --bundle-id com.example.app
python scripts/simulate_event.py --battery-level 0.05 --state unplugged

Wraps xcrun simctl notify_post com.apple.system.lowmemory and simctl io booted setBattery.

Reuses

  • resolve_device_identifier
  • app_launcher.py patterns for background/foreground transitions

Open questions

  • Which Darwin notifications beyond MemoryWarning are useful? (Thermal state, time zone change?)
  • Whether to expose raw --notify-post <name> for power users.

Definition of done

  • --memory-warning, --background, --foreground, --battery-level, --state working
  • --json, --help, SKILL.md updated

Part of the v2.0 coverage expansion epic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Polish and low-urgency itemsai-shippableDelegatable to AI agents — clarity:4+ and risk:2 or lowerblast:1Single file — one view or one service, no ripple effectsclarity:3Direction known, details TBD — can start with questionsenhancementNew feature or requestrisk:1Isolated change, well-tested area, hard to breaksize:SStraightforward, few filestype:featureNew functionality or capability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions