ios_accessibility_audit
Run an accessibility audit on the CURRENT screen of an iOS device — Apple's own XCTest audit engine (the same one Xcode's "Audit for Accessibility" button runs), so findings match what Apple reports. Audits whatever is in the foreground right now, so navigate to the screen you care about FIRST (ios_tap_by_label / ios_navigate_url), then call this. Reports contrast failures, tap targets under 44×44pt, missing/unhelpful labels, elements the accessibility engine cannot see, Dynamic Type and clipped-text problems, and wrong traits. Each issue carries the offending element's label, type and screen-point rect — the rect centre is directly tappable with ios_tap. Pass auditTypes to narrow the run (much faster on dense screens). TIMING: the audit sees the screen as it is at that instant — running it immediately after a launch or navigation, while the UI is still animating in, under-reports (measured on device: 4 issues mid-animation vs 5 once settled). Let the screen settle first. Requires iOS 17+ (errors on older) and an active iOS automation session (auto-starts if needed).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rect | No | Narrow the result to a region in screen POINTS, skipping the label lookup. Takes precedence over `element`. A finding is kept when its centre falls inside this rect. | |
| udid | Yes | iOS device UDID | |
| element | No | Narrow the result to one element: its accessibility label, resolved on device the same way ios_tap_by_label resolves it. XCTest can only audit a whole app, so this filters the findings to those inside that element's bounds — it cannot surface anything the full-screen audit did not already report. Errors if the label matches nothing, rather than silently returning the whole screen. | |
| auditType | No | Convenience alias for a single-entry auditTypes, e.g. "contrast". | |
| auditTypes | No | Audit types to run; omit for all of them. "contrast" = Text/background contrast below the WCAG threshold; "elementDetection" = Elements the accessibility engine cannot detect; "hitRegion" = Tap targets smaller than the 44×44pt minimum; "sufficientElementDescription" = Controls with a missing or unhelpful label; "dynamicType" = Text that does not scale with Dynamic Type; "textClipped" = Text clipped at larger content sizes; "trait" = Wrong or missing accessibility traits. |