An iOS network debugger for capturing and inspecting HTTP(S), HTTP/2, WebSocket, SSE, DNS, UDP, and QUIC/HTTP3 traffic directly on-device.
Trace combines a local MITM proxy, a Network Extension packet tunnel, and a self-generated root CA for HTTPS inspection. Captured data stays on-device unless you explicitly export or share it. The app supports proxy-only, full-tunnel, and dual-MITM capture, and includes replay, rewriting, diagnostics, packet capture, and widget/live activity controls.
This repository ships both Trace.xcodeproj and Package.swift:
- Use
Trace.xcodeprojto build and run the app, packet tunnel, and widget extension. - Use
Package.swiftfor package-aware indexing, module graph inspection, and module-level development.
- Proxy-only, full-tunnel, and dual-MITM capture modes
- Unified capture for HTTP(S), HTTP/2, WebSocket, SSE, DNS, TCP/UDP transport events, and QUIC/HTTP3
- Request inspection for headers, bodies, timings, TLS chain, initiator details, timing phases, and decrypted payloads when MITM is possible
- Request replay, manual request builder, copy-as-cURL, and cURL import
- Rewrite rules, request maps, breakpoints, scripts, hosts overrides, and favorites
- Capture rules for domain filtering, body capture controls, and storage limits
- Full-tunnel controls for custom DNS, IPv6, SOCKS5 forwarding, hybrid TCP MITM, and UDP forwarding mode
- Network throttling profiles for Wi-Fi, cellular, offline, and custom conditions
- Connection, UDP-flow, and DNS diagnostics
- HAR import/export, PCAP capture/export, and VPN NDJSON log export
- Certificate setup wizard, MITM allowlist, notification controls, and QUIC blocking/security settings
- gRPC metadata capture with protocol-aware body display
- Home Screen widgets, Live Activity, Control Widget actions, and quick actions
- Built-in utilities for Base64, URL encoding, JSON formatting, hashes, and timestamps
- Runtime foundation: shared NIOTS event-loop and AsyncHTTPClient lifecycle via
TraceCore/Networking/NIORuntime.swift - App-originated capture:
Trace/NetworkInterceptor.swiftremains URLProtocol-based for requests initiated by Trace itself - Request execution path:
TraceFeatures/Request/RequestExecutor.swiftuses the shared AsyncHTTPClient transport abstraction - Proxy/MITM path:
TraceProxy/MITM/MITMProxyServer.swiftdelegates toTraceProxy/MITM/NIOMITMProxyEngine.swiftfor HTTP/1.1, HTTP/2, and NIOSSL-backed MITM TLS handling - QUIC/HTTP3 path:
TraceQUICprovides the HTTP/3 client and MITM orchestration, backed byThirdParty/CQuicheFFIplusbuild/quicheartifacts produced byTools/QUIC - VPN/full-tunnel path:
TraceVPNhandles packet-tunnel routing, local SOCKS5 forwarding, UDP forwarding, PCAP capture, and NDJSON event logging
- macOS with Xcode 26.2 or newer
- iOS deployment target 16.0+
- Apple Developer signing with the Network Extension capability
- A physical iOS device for packet-tunnel and full-tunnel validation
- Rust is only required when rebuilding quiche artifacts in
Tools/QUIC/ swiftformatandswiftlintare only required for local formatting/lint checks
- Clone the repo and initialize submodules:
git clone https://github.com/Trace-iOS/Trace.git
cd Trace
git submodule update --init --recursive- Open the project:
open Trace.xcodeproj- Configure signing for
Trace,TraceVPN, andTraceWidgetExtension. - Ensure all targets use the same App Group via
APP_GROUP_IDENTIFIER. - If you change bundle identifiers, update the related entitlements and
providerBundleIdentifierinTraceFeatures/VPN/VPNManager.swift. - Build and run on a physical device for full tunnel / Network Extension validation.
If you need to validate the QUIC toolchain wiring or regenerate bundled quiche artifacts, run:
./Tools/QUIC/build_quiche_apple.sh
./Tools/QUIC/verify_quiche_symbols.sh build/quiche/quiche.xcframework- Complete onboarding and allow Trace to install the VPN configuration.
- Install and trust the Trace root CA if you want HTTPS decryption.
- Choose a capture mode in
Settings -> Capture Mode. - Start capture from the
Networktab or the widget/control widget. - Generate traffic from other apps, then inspect requests, DNS activity, WebSocket/SSE events, and connection diagnostics inside Trace.
Networktab: captured requests and network events, filters, favorites, replay, manual request builder, and cURL importToolstab: rewrite rules, request maps, scripts, hosts overrides, breakpoints, and utility toolsSettingstab: capture rules and modes, network conditions, connections, certificate and MITM settings, HAR import/export, packet captures, notifications, and storage cleanup
| Item | Default | Notes |
|---|---|---|
| App bundle ID | com.justin.trace |
Main app target |
| VPN bundle ID | com.justin.trace.vpn |
Must match providerBundleIdentifier in VPNManager |
| Widget bundle ID | com.justin.trace.tracewidget |
TraceWidgetExtension target |
| App Group | group.com.justin.trace |
Shared storage across app, VPN extension, and widget |
| Keychain group | $(AppIdentifierPrefix)com.justin.trace |
App and VPN entitlements |
Trace/
├── .github/workflows/ # GitHub Actions for build/test, format, and lint
├── Trace.xcodeproj/ # Xcode project used for app + extension builds
├── Package.swift # SwiftPM manifest that mirrors the module graph
├── Docs/ # Architecture notes and capture test plans
├── Trace/ # Main iOS app target
├── TraceVPN/ # Packet Tunnel extension source
├── TraceWidget/ # Widget source used by TraceWidgetExtension
├── TraceCore/ # Models, storage, logging, shared utilities
├── TraceCompression/ # Brotli, Deflate, and Zstd decoding
├── TraceNetworking/ # DNS parsing and shared networking diagnostics
├── TraceSecurity/ # Certificate and TLS handling
├── TraceQUIC/ # QUIC/HTTP3 client and MITM pipeline
├── TraceProxy/ # MITM proxy and capture pipeline
├── TracePacket/ # Packet parsing and TCP/UDP reassembly
├── TraceFeatures/ # Feature modules (VPN, export, scripting, cleanup, etc.)
├── TraceUI/ # Shared SwiftUI components and design system
├── TraceTests/ # Unit tests (full app module graph)
├── TraceLogicTests/ # Logic-only unit tests (no UI/extension dependencies)
├── TraceUITests/ # UI tests
├── ThirdParty/CQuicheFFI/ # C shim layer over quiche APIs
├── ThirdParty/quiche/ # Git submodule: QUIC/HTTP3 implementation
├── ThirdParty/hev-socks5-tunnel/ # Git submodule: full-tunnel SOCKS5 forwarding
├── Tools/QUIC/ # quiche build and verification scripts
├── Tools/build-tests.sh # CI wrapper for build-for-testing step
└── build/quiche/ # Generated quiche artifacts consumed by TraceQUIC/CQuicheFFI
Generated QUIC build artifacts live under build/quiche/. These artifacts are not tracked in git. iOS builds require them for QUIC/HTTP3 support, while package indexing on macOS can still resolve without them.
- Docs/index.md — documentation index with guides, reference, and explanation
- Docs/quickstart.md — install the root CA and make your first capture
- Docs/guides/capture-https.md — configure HTTPS MITM
- Docs/guides/rewrite-rules.md — modify requests and responses
- Docs/guides/export-traffic.md — export as HAR, PCAP, or cURL
- Docs/guides/full-tunnel-mode.md — capture apps that bypass the system proxy
- Docs/reference/capture-modes.md — proxy-only, full-tunnel, and dual-MITM comparison
- Docs/reference/configuration.md — bundle IDs, app group, entitlements, build flags
- Docs/explanation/capture-architecture.md — how the three capture paths work
- Docs/explanation/mitm-certificate.md — root CA and per-host certificate generation
- Docs/troubleshooting.md — known issues, common failures, and debugging paths
- Docs/StreamInterceptionV2.md describes the stream interception design
- Docs/SwiftNIO-Behavior-Parity-Contract.md documents the expected NIO behavior contract
- Docs/SwiftNIO-E2E-Capture-Test-Plan.md outlines end-to-end capture validation
Run the same base checks as the repository workflows in .github/workflows/build-and-test.yml, .github/workflows/format.yml, and .github/workflows/lint.yml:
xcodebuild -project Trace.xcodeproj -scheme Trace -configuration Debug -sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' build-for-testing
xcodebuild -project Trace.xcodeproj -scheme Trace -configuration Debug -sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' test-without-building
swiftformat --lint . --config .swiftformat
swiftlint lint --strict --config .swiftlint.ymlThe Tools/build-tests.sh script wraps the build-for-testing step with the flags used by CI (explicit DerivedData path, disabled simulator code signing).
Unit tests live in two targets:
TraceTests/— XCTest suite requiring the full app module graphTraceLogicTests/— logic-only tests with no UI or extension dependencies, runs faster in CI
SwiftLint excludes both test targets. Packet-tunnel and full-tunnel tests require a physical device.
For QUIC toolchain changes, also run:
./Tools/QUIC/build_quiche_apple.sh
./Tools/QUIC/verify_quiche_symbols.sh build/quiche/quiche.xcframeworkGitHub Actions sets an explicit DerivedData path, disables simulator code signing, and uploads an .xcresult bundle plus derived-data logs on failures.
Trace.xcodeprojis the canonical way to run the full product because it includes the app target, packet tunnel, andTraceWidgetExtension.Package.swiftmirrors the internal module graph (TraceCore,TraceSecurity,TraceProxy,TraceFeatures,TraceVPN,TraceUI,TraceQUIC, and related support targets) and is useful for navigation, indexing, and focused module work.- Packet-tunnel routing and full-tunnel traffic capture cannot be meaningfully validated in the iOS Simulator.
- Apps that ignore system proxy settings generally require full-tunnel mode
- Certificate pinning or custom trust validation prevents HTTPS MITM decryption
- QUIC/HTTP3 decryption requires the relevant MITM path plus a trusted root CA and may still fail under pinning or ECH constraints
- Packet-tunnel behavior cannot be fully validated in the iOS Simulator
See CONTRIBUTING.md for setup and PR guidance, and CODE_OF_CONDUCT.md for participation standards. Commit messages follow Conventional Commits (type(scope): summary).
See SECURITY.md for vulnerability reporting guidance.
Justin (Trace-iOS)
MIT. See LICENSE.