macOS Development
Project Setup
Requirements
- macOS 14.0+
- Xcode 16.0+
- Swift 6.0
Build & Run
Architecture
Core Components
Component | Location | Purpose |
---|---|---|
ServerManager | Core/Services/ServerManager.swift | Server lifecycle |
SessionMonitor | Core/Services/SessionMonitor.swift | Track sessions |
TTYForwardManager | Core/Services/TTYForwardManager.swift | CLI integration |
MenuBarViewModel | Presentation/ViewModels/MenuBarViewModel.swift | UI state |
Key Patterns
Observable StateServer Integration
Embedded Server
Server Launch
Settings Management
UserDefaults Keys
Key | Type | Default | Description |
---|---|---|---|
serverPort | String | ”4020” | Server port |
autostart | Bool | false | Launch at login |
allowLAN | Bool | false | LAN connections |
useDevServer | Bool | false | Development mode |
Settings Window
Menu Bar App
App Lifecycle
Status Updates
Code Signing
Entitlements
Build Settings
Sparkle Updates
Integration
Configuration
Debugging
Console Logs
View Logs
Testing
Unit Tests
UI Tests
Common Issues
Issue | Solution |
---|---|
Server won’t start | Check port availability |
Menu bar not showing | Check LSUIElement in Info.plist |
Updates not working | Verify Sparkle feed URL |
Permissions denied | Add entitlements |