
Xcode Presence
Your Xcode activity, live on Discord.
Project context
Developer tool
My contribution
Founder
Why Xcode Presence exists
Xcode Presence brings your development activity to your Discord profile through a lightweight, native macOS app. Supporting both Xcode and Xcode Beta, it displays your current file, project or Swift package, programming language, and elapsed session time.
Control exactly what you share with independent visibility settings for each field. Pause sharing manually, restrict it to when Xcode is in the foreground, or automatically suspend it after inactivity. The app runs discreetly in the menu bar and offers English and French interfaces.
Xcode Presence connects directly to the Discord desktop app through local IPC, without requiring an account token, password, or bot. It reads document metadata through macOS Accessibility without reading your source code, and excludes full file paths from activity updates.
Behind the scenes
The problem solved
Xcode Presence automates sharing your Xcode development context on Discord. It lets developers show what they are working on while choosing which details are visible, through a native app accessible from the macOS menu bar.
Behind the scenes
The app uses the macOS Accessibility API to identify the active document, determine its project, and infer its programming language from the filename. A separate module, PresenceCore, builds the activity payload from the enabled sharing fields and sends it to Discord over a local Unix socket. Background operations use bounded timeouts and validate Discord acknowledgements. When you switch to a panel without a document, such as Coding Assistant, the app retains the last detected file to preserve session continuity.
Lessons learned
- 01Lessons inferred from the implementation include handling documentless Xcode panels, distinguishing sent updates from confirmed activity, and cancelling outdated publications when sharing preferences change. The project also highlights the value of testing connection failures and privacy rules, alongside the practical work required to distribute a macOS app through universal builds, code signing, and Apple notarization.
Under the hood
The technologies that power Xcode Presence and why I chose them.
SwiftProgramming LanguageProvides direct access to native macOS frameworks and keeps the entire application in one language.
SwiftUISettings and activity interfaceMakes it straightforward to build a native interface that updates as application state changes.
AppKitMenu bar integration, windows, and application lifecycleProvides precise control over menu bar behavior, window management, and running without a Dock icon.
Keeps the interface synchronized with preferences, connection status, and detected Xcode activity.
Retrieves the current Xcode document without requiring an editor extension or reading source code contents.
Supplies system idle time to automatically pause sharing after a configurable period.
Sends activity updates directly to the desktop client through Unix sockets and JSON, without account tokens or a backend.
Stores lightweight settings such as sharing options, interface language, and the Discord Application ID.
Separates core logic from macOS integration and manages application and test targets without third-party dependencies.
Verifies sharing rules, activity payloads, preferences, localization, and transport behavior under connection failures.
Automates tests, packaging checks, signature verification, and formatting checks across configured macOS environments.
Maintains consistent formatting through local scripts and an automated CI check.
Makes application packaging, universal builds, signing, and notarization repeatable.
Packages Apple Silicon and Intel support into one release and prepares the app for distribution with Developer ID signing and Apple notarization.
Provides the menu bar, application metadata, accessibility, and local process integration the utility relies on.
Want to try Xcode Presence?
The code is open — go take a look.