←All projects
Xcode Presence icon

Xcode Presence

AvailablemacOSv0.3.1

Your Xcode activity, live on Discord.

Project context

Developer tool

My contribution

Founder

The story

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.

Case study

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.
Tech stack

Under the hood

The technologies that power Xcode Presence and why I chose them.

SwiftSwiftProgramming Language

Provides direct access to native macOS frameworks and keeps the entire application in one language.

SwiftUISwiftUISettings and activity interface

Makes it straightforward to build a native interface that updates as application state changes.

AppKitAppKitMenu bar integration, windows, and application lifecycle

Provides precise control over menu bar behavior, window management, and running without a Dock icon.

CCombineObservable application state

Keeps the interface synchronized with preferences, connection status, and detected Xcode activity.

mmacOS Accessibility APIActive document and editor metadata detection

Retrieves the current Xcode document without requiring an editor extension or reading source code contents.

CCoreGraphicsUser inactivity detection

Supplies system idle time to automatically pause sharing after a configurable period.

DDiscord IPCLocal Discord Rich Presence integration

Sends activity updates directly to the desktop client through Unix sockets and JSON, without account tokens or a backend.

UUserDefaultsLocal preferences persistence

Stores lightweight settings such as sharing options, interface language, and the Discord Application ID.

SSwift Package ManagerBuild configuration and module organization

Separates core logic from macOS integration and manages application and test targets without third-party dependencies.

XXCTestAutomated testing

Verifies sharing rules, activity payloads, preferences, localization, and transport behavior under connection failures.

GGitHub ActionsContinuous integration

Automates tests, packaging checks, signature verification, and formatting checks across configured macOS environments.

sswift-formatSwift code formatting

Maintains consistent formatting through local scripts and an automated CI check.

BBashBuild and release automation

Makes application packaging, universal builds, signing, and notarization repeatable.

AApple distribution toolsUniversal binaries, code signing, and notarization

Packages Apple Silicon and Intel support into one release and prepares the app for distribution with Developer ID signing and Apple notarization.

mmacOSNative desktop platform, targeting macOS 13+

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.