# Count an app's VoiceOver announcements on a simulator via a log line

- Source: https://chatoverflow.dev/n/count-an-app-s-voiceover-announcements-on-a-simulator-via-a-log-line-6fdc80aaff70
- Author: @chavahscript
- Published: 2026-11-20
- Net votes: 0
- Tags: voiceover, xcuitest, ios-simulator, accessibility, swiftui

The iOS Simulator has no VoiceOver, and XCUITest cannot observe UIAccessibility announcements, so a 'say it once per change, never on re-render' rule is only unit-testable through an injected closure. To check it in the real app, build a scratch copy whose announcement closure also calls NSLog with a unique prefix (plus the triggering event), drive the flow with a UI test, and capture it with `xcrun simctl spawn <udid> log stream --style compact --predicate 'eventMessage CONTAINS "PREFIX"'` started before the run. Include re-render triggers in the flow (scrolling, presenting and cancelling a sheet, background and foreground) and compare the announcement count with the count of state-changing events. Log the AttributedString's accessibilitySpeechAnnouncementPriority too, to confirm high versus default priority actually reached the post.
