Prerequisites
| Requirement | Minimum |
|---|---|
| macOS | 14.0 (Sonoma) |
| Xcode | 15.0+ |
| Swift | 5.9+ |
| SwiftLint | Latest (via Homebrew) |
| SwiftFormat | Latest (via Homebrew) |
Clone the Repository
Building
Debug Build (Command Line)
Release Build
Clean Build
Building in Xcode
OpenRockxy.xcodeproj and press Cmd+B to build, or Cmd+R to build and run.
Running Tests
All Tests
Specific Test Class
Specific Test Method
In Xcode
PressCmd+U to run all tests, or click the diamond icon next to a test method to run it individually.
Linting and Formatting
Run both before every commit:Project Structure
Rockxy uses Xcode 16+‘s file system synchronized groups — files added to directories are automatically discovered by Xcode. There is no need to manually add file references toproject.pbxproj.
SPM dependencies are declared in the Xcode project (not a top-level Package.swift). The dependency graph:
| Package | Purpose |
|---|---|
| swift-nio | Non-blocking proxy server event loop |
| swift-nio-ssl | TLS handling for HTTPS interception |
| swift-certificates | X.509 cert generation (root CA + per-host) |
| swift-crypto | Cryptographic primitives |
| SQLite.swift | Session and log persistence |
Entitlements
Rockxy requires specific entitlements to function as a network proxy:- Network Server — listens on a local port for proxy connections
- Network Client — forwards requests to upstream servers
- Keychain Access — stores the root CA private key
Sample Data (Debug Only)
Rockxy includes a sample data generator for development. It creates realistic HTTP transactions, log entries, error groups, performance metrics, and session trends so you can work on the UI without running a live proxy. Three ways to load sample data:- Launch argument — pass
-RockxySampleDatato auto-load on startup (set in Xcode scheme under Arguments Passed On Launch) - Menu — Debug builds add a Help > Load Sample Data menu item (
Cmd+Shift+D) - Toolbar — a flask icon button in the toolbar toggles sample data on/off
#if DEBUG) and is stripped from release archives.
Troubleshooting
SPM Dependencies Won’t Resolve
- Close Xcode
- Delete the
DerivedDatafolder:rm -rf ~/Library/Developer/Xcode/DerivedData/Rockxy-* - Reopen the project and let Xcode re-resolve
Build Fails with Missing Module
Ensure SPM packages are resolved: File > Packages > Resolve Package Versions. If the issue persists, reset the package cache: File > Packages > Reset Package Caches.Certificate Trust Issues at Runtime
If HTTPS interception doesn’t work after building, the root CA certificate needs to be trusted in Keychain Access. See the Installation guide for certificate setup steps.Next Steps
Architecture
Understand the actor model, coordinator pattern, and data flow
Code Style
SwiftLint rules, formatting standards, and naming conventions
