This guide covers local development for MacActivity.
The repository root contains the SwiftPM package, generated Xcode project, automation, and documentation.
.
├── Configuration/ # xcconfig, Info.plist, entitlements
├── Sources/
│ ├── MacActivityApp/ # SwiftUI/AppKit app, popover, preferences, views
│ └── MacActivityCore/ # metrics, cleanup, scheduling, preferences
├── Tests/
│ ├── MacActivityAppTests/
│ └── MacActivityCoreTests/
├── Tools/ # debug executables for focused local checks
├── scripts/ # local install/build helpers
├── .github/ # workflows, PR template, release scripts
└── docs/ # canonical project documentation
- macOS 13.0 or newer.
- Xcode 16 or newer with a Swift 6 toolchain.
- XcodeGen, when regenerating
MacActivity.xcodeprojfromproject.yml.
Package.swift declares Swift tools version 6.2 and depends on Sparkle from
version 2.9.3.
git clone https://github.com/bigtomcat6/mac-activity.git
cd mac-activityRegenerate the project after changing project.yml:
xcodegen generateOpen and run the MacActivity scheme:
open MacActivity.xcodeprojRun app and core tests from Xcode with the MacActivity scheme.
Run SwiftPM tests:
swift testIf the local sandbox or module cache causes compiler cache issues, retry with an explicit cache path:
CLANG_MODULE_CACHE_PATH=/private/tmp/clang-module-cache swift testUse Xcodebuild when validating the generated Xcode project, app-hosted tests, or workflow parity:
xcodebuild test \
-project MacActivity.xcodeproj \
-scheme MacActivity \
-destination 'platform=macOS'The project includes focused executables and command wrappers for local checks:
DebugMemoryReleaseDebugActiveProcessMemoryDebugMemoryReleaseUIDebugDiskCleanupscripts/debug-memory-release.commandscripts/debug-active-process-memory.commandscripts/debug-memory-release-ui.commandscripts/debug-disk-cleanup.command
Use these for narrow cleanup or Actives checks before broad app validation.
MacActivityCore owns behavior that should be testable without the app shell:
metric snapshots, history, providers, cleanup services, scheduling, formatting,
preferences state, update selection, and presentation models.
MacActivityApp owns the macOS app shell: status item rendering, dashboard
popover hosting, preferences window coordination, localization, Sparkle updater
integration, and SwiftUI views.
Prefer putting logic in MacActivityCore when it can be expressed without
AppKit or SwiftUI. Keep app-shell code focused on lifecycle, presentation, and
macOS integration.
Metric kinds currently include CPU, GPU, Disk, Swap, Memory, VRAM, Network, Battery, Temperature, and Fan.
Sampling profiles tune cadence by app state:
realtime: provider defaults.balanced: normal foreground sampling.background: slower memory, disk, swap, VRAM, temperature, and fan updates.energySaver: slowest nonessential sampling while keeping fast CPU and network updates.
Localization keys are centralized by AppLocalization.Key and backed by
localized string files under Sources/MacActivityApp/Resources/.
When adding user-visible text:
- Add or reuse an
AppLocalization.Key. - Update
en.lproj/Localizable.strings. - Update
zh-Hans.lproj/Localizable.strings. - Add or update localization tests when the change affects key coverage, placeholder parity, or language selection behavior.
Update documentation in the same pull request as the behavior change:
- User-visible app behavior: update user-guide.md.
- Build, test, architecture, localization, or tooling changes: update this file.
- Release workflow, versioning, artifact, updater, or release-note behavior: update release.md.
- PR policy or review requirements: update CONTRIBUTING.md.
Keep project docs under docs/. Do not add nested docs directories such as
docs/mac-activity.