Accessibility audits with AI agents for iOS and SwiftUI: Inspector, UI tests and VoiceOver
Run Accessibility Inspector's audit on every screen, then make it permanent: call performAccessibilityAudit() in an XCUITest so a change from your agent fails the test when it breaks labels, contrast or Dynamic Type. Install an accessibility skill so the agent writes the fixes, and on iOS 27 check VoiceOver's spoken output with XCUIVoiceOverService.
Last updated:
This page is about getting a coding agent (Claude Code, Cursor, Codex, or the agents inside Xcode) to find accessibility issues in an iOS or SwiftUI app, fix them, and keep them fixed. For writing and running UI tests in general, see iOS UI testing with AI agents. For a broader list of skill packs, see Best Claude Code skills for SwiftUI. Every accessibility tool in the catalog is listed under Accessibility.
What an audit checks, and what it doesn't
Apple's article "Performing accessibility audits for your app" describes the Audits pane in Accessibility Inspector: an audit inspects one screen and reports issues "such as insufficient contrast, text clipping, or missing element descriptions", with an explanation and a fix suggestion for each. The checks per platform:
| Audit (Inspector) | Platforms | What it checks (Apple's description, shortened) | Value in UI tests (XCUIAccessibilityAuditType) |
|---|---|---|---|
| Element description | All | Every accessible element has a context-specific, descriptive label | sufficientElementDescription |
| Hit region | All | The element is not too small to interact with | hitRegion |
| Contrast | All | Sufficient color contrast between overlapping elements | contrast |
| Element detection | All | Inaccessible content that should be exposed as separate accessibility children | elementDetection |
| Clipped text | iOS, watchOS, tvOS | Text labels that might clip at larger Dynamic Type sizes | textClipped |
| Traits | iOS, watchOS, tvOS | The element implements what its accessibility traits require | trait |
| Dynamic Type | iOS, watchOS, tvOS | Text supports Dynamic Type | dynamicType |
| Parent/child | macOS | Each parent-child pair in the hierarchy forms a closed loop | parentChild |
| Action | macOS | The accessibility action is valid for that type of element | action |
What it doesn't do: Apple writes that eliminating all audit issues "doesn't guarantee a fully accessible app. Always test your app with various assistive apps, such as VoiceOver". The audit covers the screen that is on display, so Apple also says to run it for every screen: first launch, login, empty states, filled states and each editing screen.
Step 1: audit each screen in Accessibility Inspector
Open it from Xcode with Xcode > Open Developer Tool > Accessibility Inspector, pick your app in the target menu, choose the audit types under Options, and click Run Audit. Click an issue to highlight the element, double-click it to inspect it, use the capture icon for a screenshot and the fix-suggestions icon for guidance on colors, font sizes or APIs.
To hand the result to an agent, save it with File > Save Audit Report As…: Apple describes it as a single HTML file with every audit result, screenshots, descriptions and fix suggestions. Give the agent the report and the matching source files, and ask it to fix one issue type at a time.
The Xcode 27 release notes list a fix for Accessibility Inspector not being able to inspect elements in simulators. Xcode 27.2 shipped on 29 Oct 2026; its release notes still list a known issue: VoiceOver, Accessibility Inspector and other accessibility tools can't convey screen content on an iPhone Duo within Device Hub.
Step 2: make the audit a UI test the agent can't ignore
A one-off audit doesn't stop the next change from breaking it again. Apple's documentation: calling performAccessibilityAudit(for:_:) on your XCUIApplication "audits the current screen for accessibility issues the same way that running an audit in Accessibility Inspector does. If the UI test finds any audit issues, it automatically fails." It is available from iOS 17, macOS 14, tvOS 17 and watchOS 10, runs on the main actor and throws.
swift
@MainActor
func testSettingsScreenPassesAccessibilityAudit() throws {
let app = XCUIApplication()
app.launch()
app.buttons["Settings"].tap()
try app.performAccessibilityAudit() // all audit types (default .all)
// or only one type, for example while you fix Dynamic Type:
// try app.performAccessibilityAudit(for: .dynamicType)
}Each issue arrives as an XCUIAccessibilityAuditIssue with auditType, compactDescription, detailedDescription and the affected element, so the failure text names what to fix. The second parameter is an optional issue handler; Apple's page doesn't document its return value, so ask the agent not to use it to silence issues without a written reason.
Rules worth adding to AGENTS.md or CLAUDE.md:
Accessibility: every screen we ship has a UI test that navigates there and calls
try app.performAccessibilityAudit(). Never remove or weaken one of these tests to make a build pass. Fix the view instead and tell me which audit type failed.
Step 3: test what VoiceOver says (iOS 27)
The Xcode 27 release notes: "XCTest now includes XCUIVoiceOverService, a new UI testing API for verifying VoiceOver behavior in your app. Use it to drive VoiceOver from UI tests and validate focus, spoken output, and navigation across supported platforms."
From Apple's API reference (XCUIAutomation, available from iOS 27, iPadOS 27, macOS 27, tvOS 27, visionOS 27 and watchOS 27):
Reach it through the
voiceOverServiceproperty onXCUIDevice("Provides access to VoiceOver for UI testing").enable(),disable()andisEnabledturn VoiceOver on and off.moveForward(),moveBackward(),moveIn()andmoveOut()move VoiceOver to the next or previous element, or into and out of a container, and return what it spoke;currentSpeech()returns the speech for the element in focus. All of them throw.The returned
Outputhasutterance, "What VoiceOver spoke for this element", with Apple's example "Add Favorites, button".
swift
@MainActor
func testFavoritesButtonIsAnnouncedCorrectly() throws {
let app = XCUIApplication()
app.launch()
let voiceOver = XCUIDevice.shared.voiceOverService
try voiceOver.enable()
defer { try? voiceOver.disable() }
let spoken = try voiceOver.moveForward()
XCTAssertEqual(spoken.utterance, "Add Favorites, button")
}The expected strings are your spec: have the agent (or a designer, with a handoff tool from the table below) write down what each element should say, then turn that list into assertions. If your app still supports iOS 26 or earlier, mark these tests @available(iOS 27, *) and keep the audit tests from step 2 for the older systems. VoiceOver on a real device is still worth a manual pass before release; see Testing on a real iPhone with AI agents.
Step 4: check system settings and text sizes
Accessibility Inspector's Settings pane (Apple: "Testing system accessibility features in your app") switches the settings your layout has to survive: Invert colors, Increase contrast, Reduce transparency, Grayscale, Reduce motion, Full Keyboard Access, Differentiate without color, Button shapes, On/Off labels, Bold fonts and Dynamic type. Window > Show Color Contrast Calculator (⌥⌘C) checks a single color pair.
For agents inside Xcode 27, the release notes add two relevant changes: the Preview Snapshot MCP tool "can now render variants such as light/dark appearance, portrait/landscape orientation, and various type size overrides", and agents "can now boot simulators, install and launch apps, synthesize touch events, and capture screenshots to verify UI behavior". Ask the agent to render the changed view at the largest type sizes before it calls a Dynamic Type fix done.
Xcode 27's accessibility specialist
The Xcode 27 release notes: "Xcode now ships with Apple-built specialists for targeted tasks, like localization, UIKit resizing and accessibility." The notes don't describe the accessibility specialist further. Use it for fixes inside Xcode; the audit tests from step 2 still decide whether the fix holds, whichever agent wrote it. For setting up agents in Xcode, see Agents inside Xcode 27.
Accessibility audit tools for agents compared
| Tool / skill | What it does (from README) | Agents | Install (from README) | License | ★ (26 Oct) | Last push |
|---|---|---|---|---|---|---|
| Apple Accessibility Skills (rgmez) | Three audit skills (SwiftUI, UIKit, AppKit): VoiceOver, Voice Control, Switch Control, keyboard, Dynamic Type, contrast, touch targets; findings by P0/P1/P2 with patch-ready fixes and manual verification steps | skills CLI, Claude Code, Codex, Cursor | npx skills add rgmez/apple-accessibility-skills@swiftui-accessibility-auditor | MIT | 33 | 25 Oct 2026 |
| HIG Doctor (raintree-technology) | Audit CLI and MCP server that checks source against the HIG and reports concerns by severity with a fix and source reference; SARIF and --fail-on for CI; 431 rules across 14 frameworks | Claude Code, Cursor, Codex, any MCP client | npx hig-doctor . (CLI), npx -y hig-mcp (MCP server) | MIT | 148 | 24 Oct 2026 |
| iOS Accessibility (dadederk) | Guidance skill: VoiceOver and Dynamic Type for UIKit and SwiftUI, Voice Control, Switch Control, Full Keyboard Access, manual and automated testing; marked work in progress | Codex, Claude Code, Cursor | npx skills add https://github.com/dadederk/iOS-Accessibility-Agent-Skill --skill ios-accessibility | MIT | 176 | 9 Mar 2026 ⚠ |
| Swift Accessibility (PasqualeVittoriosi) | Applies accessibility while writing SwiftUI, UIKit and AppKit code, audits with severity levels, and prepares the 9 App Store Accessibility Nutrition Labels | Claude Code, Codex, Cursor | /plugin marketplace add PasqualeVittoriosi/swift-accessibility-skill, /plugin install swift-accessibility-skill@swift-accessibility-skill | MIT | 83 | 9 Mar 2026 ⚠ |
| Apple Accessibility Skill (DanielJamesTronca) | Built from Apple's accessibility documentation and checked against the Xcode 27.1 SDKs; testing section covers Accessibility Inspector, audits in UI tests and iOS 27 VoiceOver automation; optional read-only audit script for Swift and Objective-C | Codex, Claude Code | npx skills add DanielJamesTronca/apple-accessibility-skill -g | MIT | 0 | 9 Oct 2026 |
| HIG Review (nlaratta) | MCP server and Claude Code plugin: 107 HIG checks with live citations from Apple, SwiftUI heuristics, and check_contrast with WCAG ratios and the HIG thresholds | Claude Code, any MCP client | /plugin marketplace add nlaratta/hig-review, /plugin install hig-review@hig-review | MIT | 0 | 11 Oct 2026 |
| SimWalk (Agulhas-Labs) | Walks your app's screens in each state (dark mode, large text, another language, right to left); simwalk bundle audit flags unlabeled controls, duplicate labels, targets under 44 pt, reading-order mismatches and text that overflows at accessibility sizes | Claude Code, any MCP client | brew install agulhas-labs/tap/simwalk, then simwalk install-hook for Claude Code | Apache-2.0 | 0 | 24 Oct 2026 |
| AppScreenMap (MKS-01) | Explores the app on an Android emulator or the iOS Simulator and maps every screen it can reach; audits include WCAG 2.2 with the fix and an official source, readable through MCP tools such as a11y_findings; iOS support is still beta per the README; early alpha | Claude Code, any MCP client | git clone https://github.com/MKS-01/appscreenmap && cd appscreenmap, make install, claude mcp add appscreenmap -- appscreenmap mcp | MIT | 2 | 23 Oct 2026 |
| Screen Reader Handoff (Nuoraneversleep) | For designers: writes the VoiceOver handoff table per screen (12 columns, including order, trait, label, value, hint and the expected announcement) as TSV, or draws it in Figma via the Figma MCP server | Claude Code, Cursor | git clone https://github.com/Nuoraneversleep/screen-reader-handoff-skill.git ~/.claude/skills/screen-reader-handoff | MIT | 1 | 18 Sep 2026 ⚠ |
⚠ = no push for more than 4 weeks. iOS Accessibility and Swift Accessibility were last updated on 9 Mar 2026 (last push); check them against iOS 27. Lumo, a design-review tool for SwiftUI and Jetpack Compose, also checks contrast. Every tool here reports candidates for review; none replaces testing with VoiceOver.
Which one to pick:
Audit a screen and get fixes: Apple Accessibility Skills, one skill per framework.
Gate source changes in CI: HIG Doctor, then the UI-test audit from step 2.
Your agent should know iOS 27's VoiceOver API: Apple Accessibility Skill; its README names audits in UI tests and iOS 27 VoiceOver automation in its testing section.
Audit every screen in every text size without writing navigation code: SimWalk; AppScreenMap if you also want a screen map and a WCAG report (iOS support is beta).
Design hands over what VoiceOver should say: Screen Reader Handoff, then turn its table into
XCUIVoiceOverServiceassertions.
A prompt that keeps the agent honest
Setting up the agent itself: Claude Code for iOS development, Codex for iOS development or Cursor rules for SwiftUI.
Use the accessibility skill. For each screen in
Features/Checkout, add a UI test that navigates there and callstry app.performAccessibilityAudit(). Run the tests, fix every failure in the view code (not in the test), and list each fix with its audit type. Then render the changed views at the largest Dynamic Type size. Our minimum is iOS 18, so put anyXCUIVoiceOverServicetest behind@available(iOS 27, *). Don't claim the screen is accessible; list what still needs a VoiceOver check by hand.
FAQ
- Can an AI agent run Apple's accessibility audit by itself?
- Yes, through a UI test. Apple's documentation says calling performAccessibilityAudit(for:_:) on your XCUIApplication audits the current screen the same way an audit in Accessibility Inspector does, and the UI test fails automatically if it finds issues. The API is available from iOS 17 and macOS 14, so an agent that runs your UI tests gets the audit result as a test failure it can read and fix.
- Which issues does an accessibility audit check?
- On every platform, Accessibility Inspector checks element descriptions (labels), hit regions that are too small, contrast and element detection. On iOS, watchOS and tvOS it adds clipped text at larger Dynamic Type sizes, traits and Dynamic Type support; on macOS it adds parent/child integrity and actions. In UI tests the same checks are values of XCUIAccessibilityAuditType, such as contrast, dynamicType and textClipped.
- Does a passing audit mean my app is accessible?
- No. Apple states that eliminating all audit issues that Accessibility Inspector reports doesn't guarantee a fully accessible app, and recommends always testing with assistive apps such as VoiceOver. Treat the audit as a regression gate, add VoiceOver checks for the flows that matter, and test on a device before release.
- How do I test VoiceOver from a UI test?
- From iOS 27, XCTest includes XCUIVoiceOverService, which Apple describes as a UI testing API for verifying VoiceOver behavior: focus, spoken output and navigation. You reach it through the voiceOverService property on XCUIDevice, turn VoiceOver on with enable(), step through elements with moveForward() or moveBackward(), and compare the utterance of each result with what VoiceOver should say.
- Which accessibility skill should I give Claude Code or Cursor?
- For audits of SwiftUI, UIKit or AppKit screens, Apple Accessibility Skills by rgmez returns P0/P1/P2 findings with patch-ready fixes and manual checks, and was last updated on 25 Oct 2026. Add HIG Doctor if you want a source scan with severities in CI. iOS Accessibility and Swift Accessibility are broader guidance skills but have not been updated since March 2026.