macOS is the rare desktop OS that is genuinely Unix-certified. Underneath the polished glass UI sits Darwin — a BSD-derived userland on the XNU kernel. That combination (real Unix, real fonts, real battery life) is why so much of the software industry develops on a Mac and ships to Linux.
← Back to Foundations| Layer | What It Does |
|---|---|
| XNU kernel | Mach + BSD + I/O Kit. Process scheduling, memory, syscalls, drivers. |
| Darwin userland | BSD-style command line — ls, ps, launchd, dyld linker. |
| Core OS / Foundation | Objective-C runtime, Foundation framework (NSString, etc.), Grand Central Dispatch. |
| Cocoa / AppKit | Windowing, controls, drag-and-drop, the desktop app model. |
| SwiftUI / Catalyst | Modern declarative UI shared with iOS; lets iPad apps run on Mac. |
| Metal | Low-level GPU API (replaces OpenGL on Apple platforms). |
Default shell is zsh (bash before 2019). Most Linux commands work — same POSIX syscalls — but flags occasionally differ (BSD sed vs GNU sed). Many developers install coreutils via Homebrew to get the GNU versions.
brew install is the de-facto package manager for macOS. Not from Apple — community-maintained. Drops binaries into /opt/homebrew on Apple Silicon, /usr/local on Intel. brew cask handles GUI apps.
Apple's IDE and toolchain. Required to build for the App Store. Bundles the Swift compiler, simulators for iPhone/iPad/Watch/TV, Instruments profiler, and the SDKs. Even non-Apple devs install xcode-select --install for the command-line compilers.
The macOS init + service manager (predates systemd). Plist-based job definitions in ~/Library/LaunchAgents for user services, /Library/LaunchDaemons for system. launchctl controls them.
Apps from outside the App Store must be code-signed by an Apple Developer ID and notarized by Apple. First launch shows a confirmation prompt. This is the price of being the OS people don't get malware on.
Even root can't modify /System, /usr, or kernel extensions while SIP is on. Requires Recovery Mode to disable. This is what prevents an installer from quietly replacing system binaries.
App Store apps run sandboxed. The TCC framework prompts for camera, microphone, contacts, full disk access. Annoying for power users; bulletproof for everyone else.