A macOS static route manager built with SwiftUI + privileged helper (XPC).
English | 简体中文
- Overview
- Feature Highlights
- Compatibility
- Download & Installation
- Usage Flow
- Usage Screenshots
- Architecture
- Build from Source
- Repository Layout
- Security Notes & Limitations
- License
StaticRouteHelper helps you manage IPv4 static routes on macOS with a desktop UI.
- Frontend: SwiftUI app (
StaticRouter) - Privileged operations: helper daemon (
RouteHelper) - IPC: typed XPC messages (
RouteWriteRequest/RouteWriteReply) - Route write path: PF_ROUTE socket (
RTM_ADD/RTM_DELETE)
- Add, edit, delete static routes
- Enable/disable routes individually
- Support both gateway modes:
- IPv4 gateway address
- Network interface (for example
utun3,en0)
- System route table viewer:
- Search
- Refresh
- "Show only my routes" filter
- Route groups (macOS 14+):
- Create, rename, reorder, delete groups
- Assign route to multiple groups
- Startup route-state calibration (sync saved state with actual system route table)
- Helper install status banner and guided recovery for SMAppService XPC failures
- English + Simplified Chinese localization
| macOS | Data layer | UI mode | Helper install method |
|---|---|---|---|
| 12-13 | Core Data | Legacy navigation | SMJobBless |
| 14+ | SwiftData (with legacy migration) | NavigationSplitView + sidebar groups | SMAppService (recommended) or SMJobBless |
Current project version in Xcode settings: 2.2.3 (build 73).
Pre-built binaries are available on GitHub Releases.
- Download and unzip the release package.
- Move
Static Router.appto your preferred location (for example~/Applications/). - Run the following command once in Terminal:
xattr -cr /path/to/Static\ Router.app- Launch the app, open Settings -> General, and install the helper.
Why step 3 is required:
- The project uses ad-hoc code signing (no paid Apple Developer certificate).
- The app is not notarized.
- Gatekeeper adds a quarantine flag to downloaded apps;
xattr -crremoves it.
- Open app and install helper from Settings -> General.
- Add a route (
destination/prefix,gateway type,gateway). - Toggle route activation in route list.
- Open System Route Table to verify actual kernel routes.
- Optionally group routes for organization (macOS 14+).
flowchart LR
A["StaticRouter (SwiftUI App)"] --> B["RouterService"]
B --> C["PrivilegedHelperManager"]
C --> D["RouteHelper (XPC Server)"]
D --> E["PF_ROUTE Socket (Kernel Routing Table)"]
B --> F["SystemRouteReader"]
F --> E
Requirements:
- macOS 12+
- Xcode 15+ recommended
Build Debug:
xcodebuild \
-project StaticRouteHelper.xcodeproj \
-scheme "Static Router" \
-configuration Debug \
buildBuild Release package (same direction as CI):
xcodebuild \
-project StaticRouteHelper.xcodeproj \
-scheme "Static Router" \
-configuration Release \
-derivedDataPath build/DerivedData
ditto -c -k --keepParent \
"build/DerivedData/Build/Products/Release/Static Router.app" \
"StaticRouteHelper-local.zip"Useful scripts:
scripts/bump-version.sh <X.Y.Z>: bump marketing/build version inproject.pbxprojscripts/validate-smappservice-health.sh [service_label]: quick health check for SMAppService launchd job
StaticRouter/: macOS app (SwiftUI)RouteHelper/: privileged helper daemonShared/: shared XPC contracts/constants.github/workflows/release.yml: build/sign/package/release workflowopenspec/: spec-driven change history
- Route operations require root privileges and a successfully installed helper.
- Current write/read implementation focuses on IPv4 routes.
- Misconfigured routes can affect host connectivity. Test carefully before applying broad destination ranges.
- If you use SMAppService on macOS 14+, system background-item approval may be required in System Settings.
StaticRouteHelper is licensed under the Apache License 2.0.
Copyright © 2021, Derek Jing


