A command-line tool that extracts the accessibility tree from iOS Simulator apps, making it easier to check WCAG compliance and enabling coding agents to understand your UI structure.
I’ve released xctree, a Swift CLI tool that extracts the accessibility tree from apps running in iOS Simulator. Think of it as a programmatic alternative to Xcode’s Accessibility Inspector.
xctree output showing the accessibility tree structure alongside the iOS Simulator
What It Does
Point it at a running simulator app and get a structured view of your UI’s accessibility properties - roles, labels, values, traits, hints, and identifiers. Output comes in either a color-coded tree view or JSON format.
xctree # Tree view with colors
xctree --format json # JSON output
xctree --width 120 # Custom text wrapping
Why This Matters
WCAG Compliance: When building accessible apps, you need to verify that UI elements have proper labels, roles, and hints. Instead of manually clicking through Xcode’s inspector, you can now script these checks or integrate them into your CI pipeline.
Coding Agents: Tools like Claude Code can now understand your app’s UI structure without screenshots. Need to verify that a button has the correct accessibility label? The agent can run xctree and see exactly what’s exposed to assistive technologies.
Installation
Install via Homebrew:
brew tap ldomaradzki/xctree
brew install xctree
Or grab it from GitHub and build with Swift Package Manager.