Guide
Read code and docs aloud in Xcode on Mac: what works and what doesn't
Xcode is where Mac developers read all day — documentation, doc comments, review notes, commit messages, pages of build output — and Apple never gave it a listen button. There's no speech command anywhere in the editor, the console or the documentation viewer. The good news: the text in all of them is selectable, so the Mac's built-in speech and reader apps work, and Terminal can read a whole file with one command.
Updated 22 November 2026.
Short answerXcode has no built-in read-aloud — nothing in the menus reads editor text, console output or documentation. What does work: select text anywhere in Xcode — the source editor, the debug console, the build log, the documentation viewer — and press Option-Esc (Speak Selection), or Control-Option-S in Aloud to read it with word-by-word highlight. For whole files, cat README.md | say or say -f file.swift in Terminal. Stick to prose: Swift and Objective-C code read literally sounds like punctuation soup.
What's worth listening to in Xcode (and what isn't)
The listen-worthy text in Xcode is prose: Apple's documentation in the Developer Documentation window, doc comments and Markdown documentation catalogs in your own project, README and design notes in the navigator, commit messages you're drafting in the source-control view, and long error messages or console output you keep re-reading. The unlistenable kind is the code itself — a speech engine reads func update ( _ state : State ) -> Void { literally, so you hear every keyword, paren and colon. Listening to a function rarely beats skimming it; listening to the doc comment that explains it often does.
Option-Esc: the fastest answer
- Turn on Speak Selection once: System Settings → Accessibility → Read & Speak (Spoken Content on older macOS) → Speak selection.
- In Xcode, select the prose you want — paragraphs in the documentation viewer, a doc comment, the console output after a run.
- Press Option-Esc. Your Mac reads the selection in its current voice.
This works in the source editor, the debug console, the build log, the documentation viewer and the commit-message field — they're all selectable text. It doesn't work on the Interface Builder or SwiftUI preview canvas, where text is drawn, not selectable. Skip Command-A on a source file: it reads the code exactly as written — every brace and semicolon.
Terminal one-liners for whole files
Xcode projects are just folders — the Mac's say command reads any text you point it at, no setup:
say -f README.md— reads a whole file start to finish.cat Sources/Notes.swift | say— same thing through a pipe.pbpaste | say— reads whatever's on the clipboard.say -f long-doc.md -o notes.aiff— renders to an audio file instead of playing it.
For build output, run xcodebuild in Terminal and pipe the log through say — or more usefully, select the actual error lines in Xcode's build log and read just those. The voice is your Mac's default, with no highlight or pause control — fine for a short file, clunky for a long one.
The traps that make Xcode sound wrong
- Command-A on a source file — reads the syntax literally: braces, generics, colons, indentation as dead air.
- Build logs are mostly noise — file paths, phase names and timing lines outnumber the error you actually want. Select the error lines, not the log.
- The canvas isn't text — Interface Builder and SwiftUI previews draw the interface; nothing there is selectable. Option-Esc won't reach it (screen-area reading can).
- Doc comments read their markup —
/// - Parameter name:reads the slashes and dashes too. Select the description text, or accept a little extra punctuation. - VoiceOver is something else — Xcode works with VoiceOver, but that's full spoken navigation for blind users, a different job than listening to a document end to end.
A read-aloud setup that covers Xcode and everything else
The pragmatic pattern: read code with your eyes, listen to the prose around it. With Aloud (ours, $19 once per Mac, macOS 14 or later):
- Control-Option-S reads a selection in any app — the Xcode editor, the documentation viewer, the console, a diff in your Git client.
- Control-Option-O reads unselectable text — drag a screen area over a SwiftUI preview, an Interface Builder canvas, or a crash report someone sent as a screenshot.
- Export to .m4a — turn a design doc or a long API reference into an audio file for the commute.
- Word-by-word highlight with click-to-seek, 0.75x–2x speed, a sleep timer, and resume from the last sentence.
- Natural voices: your Mac's Enhanced and Premium voices, the on-device Kokoro neural voice (Apple silicon, macOS 15+), or ElevenLabs (v4, v4 Turbo or v3) or Cartesia with your own API key.
Buy Aloud, $19 once No subscription, no account.
Questions
Can Xcode read text aloud?
Not on its own — there is no read-aloud or text-to-speech command anywhere in Xcode, in the editor, the console or the documentation viewer. To hear what's on screen on a Mac, select the text and press Option-Esc (Speak Selection), or use a reader app like Aloud (Control-Option-S). VoiceOver can also speak Xcode's interface, but that's a full screen reader, not a document listener.
How do I make Xcode read a file aloud on Mac?
For a whole file, Terminal is fastest: say -f README.md reads it in your Mac's voice, and say -f file.md -o out.aiff renders it to an audio file. For part of a file, select the paragraphs in the editor and press Option-Esc with Speak Selection enabled, or use a reader app's selection shortcut. Stick to prose — code read literally sounds like punctuation soup.
Is there a text-to-speech extension for Xcode?
No — Xcode's extension system (Source Editor extensions) covers editing commands, not speech, and there is no mainstream Xcode extension that adds read-aloud. The practical routes are the Mac's own Speak Selection (Option-Esc), the say command in Terminal, or a system-wide reader app that reads the selection in any app.
Why does Xcode read-aloud sound like gibberish?
You selected code. Speech engines read syntax literally — braces, angle brackets in generics, colons, semicolons — which comes out as punctuation soup. Read-aloud works on prose: documentation, doc comments, commit messages, error text. Select the paragraphs and skip the code blocks.
More Mac utilities from the developer: SnapState puts your Mac windows, apps and browser tabs back after sleep or a monitor reconnect. $9.99 one-time.