{"id":49210490,"url":"https://github.com/synaptode/phantomswift","last_synced_at":"2026-04-23T21:01:09.248Z","repository":{"id":347951904,"uuid":"1193988516","full_name":"synaptode/PhantomSwift","owner":"synaptode","description":"iOS debug toolkit: network inspector, memory leak tracker, UI hierarchy, 25 modules. Zero deps. SPM + CocoaPods. #if DEBUG safe.","archived":false,"fork":false,"pushed_at":"2026-04-17T17:30:30.000Z","size":8886,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-17T19:16:59.356Z","etag":null,"topics":["cocoapods","debug-toolkit","debugging","developer-tools","ios","ios-debugging","ios-library","memory-leak","mobile","network-inspector","open-source","swift","swift-package-manager","uitesting","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/synaptode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-27T19:50:16.000Z","updated_at":"2026-04-08T22:41:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/synaptode/PhantomSwift","commit_stats":null,"previous_names":["synaptode/phantomswift"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/synaptode/PhantomSwift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synaptode%2FPhantomSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synaptode%2FPhantomSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synaptode%2FPhantomSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synaptode%2FPhantomSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synaptode","download_url":"https://codeload.github.com/synaptode/PhantomSwift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synaptode%2FPhantomSwift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32198232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T20:19:26.138Z","status":"ssl_error","status_checked_at":"2026-04-23T20:19:23.520Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","debug-toolkit","debugging","developer-tools","ios","ios-debugging","ios-library","memory-leak","mobile","network-inspector","open-source","swift","swift-package-manager","uitesting","xcode"],"created_at":"2026-04-23T21:01:08.477Z","updated_at":"2026-04-23T21:01:09.238Z","avatar_url":"https://github.com/synaptode.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"  \u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/logo.png\" width=\"250\" alt=\"PhantomSwift Logo\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003ePHANTOM SWIFT\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eThe Elite, Zero-Dependency iOS Debugging \u0026 Diagnostic Toolkit\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/synaptode/PhantomSwift/releases/tag/v1.1.1\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/version-1.1.1-blue.svg?style=flat\" alt=\"Version 1.1.1\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/synaptode/PhantomSwift/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg?style=flat\" alt=\"MIT License\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Dependencies-Zero-brightgreen.svg?style=flat\" alt=\"Zero Dependencies\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Modules-25-7C3AED.svg?style=flat\" alt=\"25 Modules\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/%23if%20DEBUG-Safe-orange.svg?style=flat\" alt=\"DEBUG only\"\u003e\n  \u003ca href=\"https://swiftpackageindex.com/synaptode/PhantomSwift\"\u003e\n    \u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fsynaptode%2FPhantomSwift%2Fbadge%3Ftype%3Dswift-versions\" alt=\"Swift Versions\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://swiftpackageindex.com/synaptode/PhantomSwift\"\u003e\n    \u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fsynaptode%2FPhantomSwift%2Fbadge%3Ftype%3Dplatforms\" alt=\"Supported Platforms\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nPhantomSwift is an open-source iOS debugging library for Swift developers.\nIt provides network inspection, memory leak detection, UI hierarchy exploration,\nand 25+ diagnostic tools — all in a single zero-dependency package.\nCompatible with UIKit and SwiftUI, installable via SPM or CocoaPods, with a minimum runtime target of iOS 12 and a validated Swift 5.9+ toolchain.\n\u003c/p\u003e\n\n---\n\n## Overview\n\n**PhantomSwift** is a professional-grade, modular debugging ecosystem for iOS apps. It ships **25 rich modules** — from network inspection and performance profiling to remote WebSocket debugging and macro recording — all wrapped in a premium glassmorphic UI. Every line of code is compiled only in `DEBUG` builds, so it adds **zero overhead** to your production binary.\n\n### Why PhantomSwift?\n\n| | PhantomSwift | FLEX | Pulse | Netfox |\n|---|:---:|:---:|:---:|:---:|\n| **Zero dependencies** | ✅ | ✅ | ❌ | ✅ |\n| **`#if DEBUG` safe** | ✅ | ❌ | ❌ | ❌ |\n| **Network inspection** | ✅ | ✅ | ✅ | ✅ |\n| **3D view hierarchy** | ✅ | ✅ | ❌ | ❌ |\n| **Performance monitoring** | ✅ | ❌ | ❌ | ❌ |\n| **Request interception** | ✅ | ❌ | ❌ | ❌ |\n| **Bad network simulation** | ✅ | ❌ | ❌ | ❌ |\n| **Feature flags** | ✅ | ❌ | ❌ | ❌ |\n| **Remote WebSocket server** | ✅ | ❌ | ✅ | ❌ |\n| **Memory leak tracker** | ✅ | ✅ | ❌ | ❌ |\n| **Macro recorder** | ✅ | ❌ | ❌ | ❌ |\n| **Security audit** | ✅ | ❌ | ❌ | ❌ |\n| **Bug reporter** | ✅ | ❌ | ❌ | ❌ |\n| **Glassmorphic UI** | ✅ | ❌ | ✅ | ❌ |\n| **Module count** | **25** | ~8 | ~5 | 1 |\n\n### Looking for an Alternative?\n\n- **FLEX alternative** — PhantomSwift covers everything FLEX does, plus network mocking, bad network simulation, feature flags, and a glassmorphic UI.\n- **Netfox replacement** — PhantomSwift includes all Netfox's network inspection with 25 additional modules, and is also `#if DEBUG` safe.\n- **Pulse iOS alternative** — PhantomSwift adds zero-dependency constraint with full UIKit + SwiftUI support and no external packages required.\n\n### Key Principles\n\n- **Zero external dependencies** — built entirely with Apple frameworks\n- **`#if DEBUG` safe** — every file is wrapped; nothing ships to the App Store\n- **iOS 12+ runtime support** — with `#available` guards for newer APIs\n- **Swift 5.x aligned** — validated with Swift 5.9+ toolchains\n- **Glassmorphic UI** — premium dark theme with blur, shadows, and micro-animations\n- **Modular architecture** — enable or disable any module independently\n\n---\n\n## Table of Contents\n\n- [Screenshots](#screenshots)\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Modules in Detail](#modules-in-detail)\n- [Architecture](#architecture)\n- [Configuration](#configuration)\n- [Requirements](#requirements)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## Screenshots\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/dashboard/phantom-dashboard.png\" width=\"250\" alt=\"Dashboard\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/network/phantom-network.png\" width=\"250\" alt=\"Network Trace\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/performance/performance.png\" width=\"250\" alt=\"Performance\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/ui-inspector/ui-inspector-tree-3d.png\" width=\"250\" alt=\"3D View Hierarchy\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/storage/storage.png\" width=\"250\" alt=\"Storage Inspector\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/logger/logger.png\" width=\"250\" alt=\"Console Logger\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/interceptors/interceptors.png\" width=\"250\" alt=\"Interceptors\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/security/security-1.png\" width=\"250\" alt=\"Security Audit\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/memory-graph/memory-graph.png\" width=\"250\" alt=\"Memory Graph\"\u003e\n\u003c/p\u003e\n\n---\n\n## Features\n\n### Connectivity \u0026 API\n\n| Module | Description |\n|--------|-------------|\n| **Network Trace** | Real-time HTTP/HTTPS traffic monitoring with full request/response inspection, HAR export, and search/filter |\n| **Interceptor** | Mock, block, delay, or redirect any request. Mockoon redirect support. Hit counters and exclude patterns |\n| **Bad Network** | Simulate poor connectivity (3G, Edge, packet loss, latency) with one tap |\n| **Network Waterfall** | Chrome DevTools-style waterfall timeline showing request durations and concurrency |\n| **Request Replay** | Edit and replay any captured request. Save responses as mock rules |\n| **HAR Export** | Export network traces as HAR 1.2 JSON files for sharing with backend teams |\n\n### Performance \u0026 Diagnostics\n\n| Module | Description |\n|--------|-------------|\n| **Performance Monitor** | Real-time CPU, FPS, and RAM tracking with interactive timeline graphs |\n| **Hang Detector** | Main-thread freeze detection (\u003e400ms) with full call stack capture |\n| **Main Thread Checker** | Detects UIKit calls from background threads via method swizzling |\n| **Memory Leak Tracker** | Automatic retain cycle detection with object lifecycle tracking |\n| **Memory Graph \u0026 Diff** | Visual object relationship explorer and heap snapshot comparator |\n\n### UI \u0026 Design Systems\n\n| Module | Description |\n|--------|-------------|\n| **UI Inspector** | Live property inspection with constraint details, measurement tool |\n| **3D View Hierarchy** | Xcode-style exploded 3D view with tap-to-select, depth slider, wireframe toggle, and pinch-to-zoom |\n| **SwiftUI Render Tracker** | Track re-render frequency per SwiftUI component |\n| **Asset Inspector** | Audit image/video assets for memory optimization and sizing |\n| **Accessibility Audit** | Scan for missing labels, small touch targets, and A11y violations |\n| **Layout Conflict** | Detect and display Auto Layout constraint conflicts in real-time |\n\n### Storage \u0026 State\n\n| Module | Description |\n|--------|-------------|\n| **Storage Inspector** | Browse and edit UserDefaults, Keychain, sandbox files, and SQLite databases |\n| **State Snapshot** | Save entire app state (defaults, files) and restore it instantly |\n\n### Developer Toolkit\n\n| Module | Description |\n|--------|-------------|\n| **Console Logger** | Priority-level logging with tags, metadata, and full-text search |\n| **Analytics Interceptor** | Intercept and inspect analytics events (Firebase, Amplitude, custom) |\n| **Feature Flags** | Register, toggle, and persist feature flags with grouped UI |\n| **Bug Reporter** | Annotate screenshots with freehand drawing, export diagnostic bundles |\n| **Macro Recorder** | Record touch sequences and replay them for QA regression testing |\n| **Remote Server** | WebSocket debug server for real-time remote inspection |\n| **Security Audit** | Jailbreak detection, SSL pinning check, and binary integrity verification |\n| **Environment Swapper** | Spoof GPS, change locale, monitor battery/thermal state |\n| **Runtime Browser** | Browse Objective-C classes, methods, and properties at runtime |\n| **Push Notification Tester** | Simulate and test push notifications locally |\n| **Deeplink Tester** | Test URL schemes and universal links without leaving the app |\n\n---\n\n## Installation\n\n### Swift Package Manager (Recommended)\n\nAdd PhantomSwift via Xcode:\n\n1. **File → Add Package Dependencies...**\n2. Enter the repository URL:\n   ```\n   https://github.com/synaptode/PhantomSwift.git\n   ```\n3. Select version rule: **Up to Next Major**\n4. Add to your **Debug** target only\n\nOr add it to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/synaptode/PhantomSwift.git\", from: \"1.1.1\")\n]\n```\n\n### CocoaPods\n\n```ruby\npod 'PhantomSwift', :configurations =\u003e ['Debug']\n```\n\n\u003e **Important:** Always add PhantomSwift to your **Debug** configuration only. All code is wrapped in `#if DEBUG`, but restricting the dependency ensures zero bytes in release builds.\n\u003e\n\u003e **Compatibility:** PhantomSwift supports **iOS 12.0+** at runtime. The current package manifest and CocoaPods spec are validated with **Swift 5.9+** toolchains, which keeps the library within the Swift 5 generation while matching the repo's actual build settings.\n\n---\n\n## Quick Start\n\n### SwiftUI\n\n```swift\nimport SwiftUI\n#if DEBUG\nimport PhantomSwift\n#endif\n\n@main\nstruct MyApp: App {\n    init() {\n        #if DEBUG\n        PhantomSwift.configure { config in\n            config.environment = .dev\n            config.triggers = [.shake, .dynamicIsland]\n            config.theme = .dark\n        }\n        PhantomSwift.launch()\n        #endif\n    }\n\n    var body: some Scene {\n        WindowGroup { ContentView() }\n    }\n}\n```\n\n### UIKit\n\n```swift\nimport UIKit\n#if DEBUG\nimport PhantomSwift\n#endif\n\n@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n    func application(_ application: UIApplication,\n                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool {\n        #if DEBUG\n        PhantomSwift.configure { config in\n            config.environment = .dev\n            config.triggers = [.shake]\n            config.theme = .dark\n            config.shortcuts = [\n                AppShortcut(title: \"Clear Cache\") {\n                    URLCache.shared.removeAllCachedResponses()\n                }\n            ]\n        }\n        PhantomSwift.launch()\n        #endif\n        return true\n    }\n}\n```\n\n### Accessing the Dashboard\n\n| Trigger | How |\n|---------|-----|\n| **Shake** | Shake your device (default trigger) |\n| **Dynamic Island** | Tap the floating pill overlay |\n\nBoth triggers can be configured via `config.triggers`.\n\n---\n\n## Modules in Detail\n\n### 📋 Dashboard\n\nThe central hub for all PhantomSwift modules. A Niagara-style A→Z scrollable grid displays every available module with a glassmorphic card UI.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/dashboard/phantom-dashboard.png\" width=\"300\" alt=\"PhantomSwift Dashboard\"\u003e\n\u003c/p\u003e\n\nThe dashboard provides quick access to all 25 modules. Each card shows the module icon, name, and a brief description. Enabled modules are highlighted with a colored accent glow.\n\n---\n\n### 🌐 Network Trace\n\nAutomatically captures all HTTP/HTTPS traffic via `URLProtocol` swizzling. Provides a detailed view of every request and response flowing through your app.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/network/phantom-network.png\" width=\"220\" alt=\"Network List\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/network/phantom-network-overview.png\" width=\"220\" alt=\"Network Overview\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/network/phantom-network-headers.png\" width=\"220\" alt=\"Network Headers\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/network/phantom-network-body.png\" width=\"220\" alt=\"Network Body\"\u003e\n\u003c/p\u003e\n\n**Capabilities:**\n- Full request/response body inspection with JSON pretty-printing\n- Status code color-coding (2xx green, 4xx orange, 5xx red)\n- Header inspection with copy-to-clipboard\n- Text search and status code filtering\n- HAR 1.2 export for sharing with backend teams\n- Request edit \u0026 replay\n- Automatic content-type detection (JSON, XML, HTML, image)\n\n---\n\n### 🚧 Interceptor\n\nCreate rules to intercept matching network requests. Supports multiple interception strategies to simulate various backend scenarios without modifying server code.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/interceptors/interceptors.png\" width=\"300\" alt=\"Interceptor Rules\"\u003e\n\u003c/p\u003e\n\n**Rule Types:**\n| Type | Description |\n|------|-------------|\n| **Mock** | Return a custom JSON/text response body |\n| **Block** | Prevent the request from executing entirely |\n| **Redirect** | Forward to a different URL (e.g., Mockoon server) |\n| **Delay** | Add artificial latency (100ms – 30s) |\n\n**Features:**\n- URL pattern matching with wildcards\n- Hit counter per rule\n- Exclude patterns to bypass specific endpoints\n- Per-rule enable/disable toggle\n- Import/export rule sets\n\n---\n\n### 📡 Bad Network Simulator\n\nSimulate poor network conditions to test your app’s resilience — no proxy tools or extra setup required.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/bad-network/bad-network-simulation.png\" width=\"300\" alt=\"Bad Network Simulation\"\u003e\n\u003c/p\u003e\n\n**Presets:**\n| Profile | Latency | Throughput | Packet Loss |\n|---------|---------|------------|-------------|\n| **WiFi** | 2ms | Unlimited | 0% |\n| **4G/LTE** | 50ms | 12 Mbps | 1% |\n| **3G** | 200ms | 1.6 Mbps | 2% |\n| **Edge** | 400ms | 240 Kbps | 5% |\n| **GPRS** | 500ms | 50 Kbps | 10% |\n| **Offline** | ∞ | 0 | 100% |\n\nAll parameters (latency, throughput, packet loss) are individually adjustable with sliders for custom profiles.\n\n---\n\n### 📊 Network Waterfall\n\nChrome DevTools-style waterfall timeline showing request durations and concurrency — a visual overview of how your network requests overlap in time.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/waterfall/waterfall.png\" width=\"300\" alt=\"Network Waterfall\"\u003e\n\u003c/p\u003e\n\n**What it shows:**\n- DNS lookup, connection, SSL, TTFB, and content download phases\n- Concurrent request overlap visualization\n- Color-coded bars by content type (API, image, script)\n- Total page load time calculation\n- Tap any bar to jump to the full request detail\n\n---\n\n### ⚡ Performance Monitor\n\nReal-time CPU, FPS, and RAM tracking with interactive timeline graphs. Spot performance bottlenecks as they happen.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/performance/performance.png\" width=\"300\" alt=\"Performance Monitor\"\u003e\n\u003c/p\u003e\n\n**Metrics tracked:**\n- **CPU Usage** — per-process CPU utilization percentage\n- **FPS** — frames per second from `CADisplayLink` (drops highlighted in red)\n- **Memory** — resident set size (RSS) in MB with peak tracking\n- **Thermal State** — device thermal state monitoring (nominal → critical)\n\nInteractive timeline lets you scrub through the last 60 seconds of data. Anomalies (FPS drops, CPU spikes, memory warnings) are highlighted with markers.\n\n---\n\n### 📝 Console Logger\n\nA priority-level logging system with tags, metadata, and full-text search. Replaces `print()` with structured, filterable output.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/logger/logger.png\" width=\"300\" alt=\"Console Logger\"\u003e\n\u003c/p\u003e\n\n**Usage:**\n\n```swift\n#if DEBUG\nPhantomLog.debug(\"View loaded\", tag: \"UI\")\nPhantomLog.info(\"User signed in\", tag: \"Auth\")\nPhantomLog.warning(\"Cache miss for key: \\(key)\", tag: \"Cache\")\nPhantomLog.error(\"Failed to decode response\", tag: \"Network\")\n#endif\n```\n\n**Features:**\n- Five priority levels: `verbose`, `debug`, `info`, `warning`, `error`\n- Tag-based filtering (e.g., show only \"Network\" logs)\n- Full-text search across all log entries\n- Timestamp with millisecond precision\n- Export logs as text file\n- OSLog bridge for unified logging (iOS 14+)\n- Plug-and-play `WKWebView` console capture for `console.log`, `console.warn`, `console.error`, and JS bridge payloads\n\n**Plug-and-play for hybrid HTML/native apps:**\n\nAfter `PhantomSwift.launch()`, new `WKWebView` instances are instrumented automatically when the\nLogger module is enabled. That means browser-side logs like `console.log(\"bridge ready\")` and\n`console.error(\"checkout failed\", payload)` will appear in PhantomSwift's **Console Logger**\nwithout you wiring each web view manually.\n\nIf you want explicit control over handler naming or tagging, you can still install the bridge yourself:\n\n```swift\nimport WebKit\n#if DEBUG\nimport PhantomSwift\n#endif\n\nfinal class CheckoutWebVC: UIViewController {\n    #if DEBUG\n    private let phantomConsoleBridge = PhantomWebViewConsoleBridge(\n        configuration: .init(handlerName: \"phantomConsole\", tag: \"CheckoutJS\")\n    )\n    #endif\n\n    private lazy var webView: WKWebView = {\n        let configuration = WKWebViewConfiguration()\n        #if DEBUG\n        phantomConsoleBridge.install(into: configuration)\n        #endif\n        return WKWebView(frame: .zero, configuration: configuration)\n    }()\n}\n```\n\nIf you already have your own JS bridge, you can also forward messages manually from native:\n\n```swift\n#if DEBUG\nPhantomWebViewConsoleBridge.capture(\n    level: .error,\n    message: \"window.checkoutBridge rejected payload\",\n    tag: \"CheckoutJS\",\n    sourceURL: webView.url?.absoluteString\n)\n#endif\n```\n\nYou can disable the automatic mode if your host app needs stricter ownership over `WKWebView` setup:\n\n```swift\n#if DEBUG\nPhantomSwift.configure { config in\n    config.enableAutomaticWebViewConsoleBridge = false\n}\n#endif\n```\n\n---\n\n### 🔍 UI Inspector \u0026 3D Hierarchy\n\nInspect any view in your app hierarchy — tap to select, view properties, constraints, and spatial relationships. The 3D exploded view provides an Xcode-style visualization of the entire view tree.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/ui-inspector/ui-inspector-tree.png\" width=\"220\" alt=\"View Tree\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/ui-inspector/ui-inspector-selected.png\" width=\"220\" alt=\"Selected View\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/ui-inspector/ui-inspector-detail.png\" width=\"220\" alt=\"View Detail\"\u003e\n\u003c/p\u003e\n\n**UI Inspector features:**\n- Tap-to-select any view in the hierarchy\n- Property inspection: frame, bounds, alpha, backgroundColor, accessibilityLabel\n- Constraint list with priority, constant, multiplier\n- Live editing of properties (frame, alpha, backgroundColor)\n- Measurement tool — measure distance between any two views\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/ui-inspector/ui-inspector-tree-3d.png\" width=\"250\" alt=\"3D Hierarchy\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/ui-inspector/ui-inspector-measurement.png\" width=\"250\" alt=\"Measurement Tool\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/ui-inspector/ui-inspector-edit.png\" width=\"250\" alt=\"Live Edit\"\u003e\n\u003c/p\u003e\n\n**3D Hierarchy features:**\n- Exploded 3D view with adjustable spacing\n- Depth filter slider to focus on specific layers\n- Rotate X/Y sliders for precise camera control\n- Wireframe mode to see layout structure\n- Class name labels overlay\n- Tap any layer to open the inspector sheet\n- Pinch to zoom, 1-finger pan, 2-finger orbit\n- Fit All \u0026 Reset camera controls\n- Mini-map overlay for orientation\n\n---\n\n### 🧠 Memory Leak Tracker \u0026 Graph\n\nAutomatic retain cycle detection with object lifecycle tracking. The memory graph visualizes object relationships to help identify where leaks occur.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/memory-leaks/memory-leaks.png\" width=\"280\" alt=\"Memory Leak Tracker\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/memory-graph/memory-graph.png\" width=\"280\" alt=\"Memory Graph\"\u003e\n\u003c/p\u003e\n\n**Leak Tracker:**\n- Tracks `UIViewController` and `UIView` lifecycle via swizzling\n- Detects objects that are not deallocated after dismissal (potential leaks)\n- Shows class name, allocation time, and retain count\n- Configurable detection delay (default: 3s after dismissal)\n\n**Memory Graph:**\n- Visual directed graph of object references\n- Interactive nodes — tap to inspect properties\n- Snapshot comparison (diff between two heap states)\n- Highlights potential retain cycles with red edges\n\n---\n\n### 💾 Storage Inspector\n\nBrowse and edit all local storage mechanisms from a single interface.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/storage/storage.png\" width=\"300\" alt=\"Storage Inspector\"\u003e\n\u003c/p\u003e\n\n**Supported storage types:**\n| Storage | Capabilities |\n|---------|-------------|\n| **UserDefaults** | Browse, edit, delete keys. Type-aware editing (String, Int, Bool, Date, Array, Dictionary) |\n| **Keychain** | Read and delete keychain items. Filtered by app’s access group |\n| **Sandbox Files** | Navigate the app’s Documents, Library, and tmp directories. View file contents, sizes, dates |\n| **SQLite** | Browse tables, execute raw SQL queries, view schema |\n\nAll edits are reflected immediately — no app restart needed.\n\n---\n\n### 📈 Analytics Interceptor\n\nIntercept and inspect analytics events from any provider without modifying your analytics code.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/analytics/analytics-feed.png\" width=\"280\" alt=\"Analytics Feed\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/analytics/analytics-by-provider.png\" width=\"280\" alt=\"Analytics by Provider\"\u003e\n\u003c/p\u003e\n\n**Supported providers:**\n- Firebase Analytics\n- Amplitude\n- Mixpanel\n- Custom event buses\n\n**Features:**\n- Real-time event feed with timestamp, name, and parameters\n- Group-by-provider view to see event distribution\n- Search and filter by event name or parameter value\n- Event validation — warns about missing required parameters\n\n---\n\n### 🚩 Feature Flags\n\nRuntime feature flag management with a beautiful grouped UI. Toggle features on-the-fly without recompilation.\n\n```swift\n#if DEBUG\n// Register flags at launch\nPhantomFeatureFlags.shared.register(key: \"new_onboarding\", title: \"New Onboarding Flow\",\n                                     defaultValue: false, group: \"UX\")\nPhantomFeatureFlags.shared.register(key: \"dark_mode_v2\", title: \"Dark Mode V2\",\n                                     defaultValue: true, group: \"Theme\")\n\n// Check flags anywhere\nif PhantomFeatureFlags.shared.isEnabled(\"new_onboarding\") {\n    showNewOnboarding()\n}\n#endif\n```\n\n**Features:**\n- Register flags with key, title, description, default value, and group\n- Toggle overrides from the dashboard with immediate effect\n- Overrides persist across app launches via UserDefaults\n- Reset individual flags or all at once\n- Override badge count shown on the dashboard card\n\n---\n\n### 🔒 Security Audit\n\nComprehensive security analysis of your app’s runtime environment.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/security/security-1.png\" width=\"280\" alt=\"Security Audit Overview\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/security/security-2.png\" width=\"280\" alt=\"Security Audit Details\"\u003e\n\u003c/p\u003e\n\n**Checks performed:**\n| Check | Description |\n|-------|-------------|\n| **Jailbreak Detection** | Checks for Cydia, unusual paths, writable system dirs |\n| **SSL Pinning** | Validates certificate pinning implementation |\n| **Debugger Detection** | Detects if a debugger is attached |\n| **Binary Integrity** | Checks code signature and encryption status |\n| **Keychain Security** | Validates keychain access control settings |\n| **App Transport Security** | Checks ATS exceptions in Info.plist |\n\nResults are color-coded: 🟢 Pass, 🟡 Warning, 🔴 Fail — with remediation suggestions.\n\n---\n\n### 🖼 Asset Inspector\n\nAudit image and video assets for memory optimization, sizing, and potential issues.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/asset-inspector/asset-inspector.png\" width=\"300\" alt=\"Asset Inspector\"\u003e\n\u003c/p\u003e\n\n**Analysis includes:**\n- Image dimensions vs. display size (flags oversized images)\n- Memory footprint calculation per asset\n- Format identification (PNG, JPEG, HEIF, WebP, PDF)\n- Missing @2x/@3x variants detection\n- Total asset catalog size summary\n\n---\n\n### 🌍 Environment Swapper\n\nOverride device environment settings for testing — no need to physically move or change device settings.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/environment/environment-relay-1.png\" width=\"220\" alt=\"Environment Overview\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/environment/environment-relay-2.png\" width=\"220\" alt=\"GPS Spoofing\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/environment/environment-relay-3.png\" width=\"220\" alt=\"Locale Override\"\u003e\n\u003c/p\u003e\n\n**Capabilities:**\n- **GPS Spoofing** — Set custom coordinates for location-dependent features\n- **Locale Override** — Change app locale without changing device settings\n- **Battery Monitoring** — Real-time battery level and charging state\n- **Thermal State** — Monitor device temperature state\n- **Time Zone Override** — Test time-sensitive features across zones\n\n---\n\n### 🔬 Runtime Browser\n\nBrowse Objective-C classes, methods, and properties at runtime — a powerful introspection tool for understanding third-party SDKs.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/runtime-browser/runtime_browser.png\" width=\"300\" alt=\"Runtime Browser\"\u003e\n\u003c/p\u003e\n\n**Features:**\n- Browse all loaded Objective-C classes\n- Inspect instance methods, class methods, and properties\n- View method signatures and return types\n- Search by class name or method name\n- Filter by framework/module\n\n---\n\n### ⚠️ Layout Conflict Detector\n\nDetects Auto Layout constraint conflicts in real-time and displays them in a clear, actionable format.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/layout-conflict/layout_conflict.png\" width=\"300\" alt=\"Layout Conflict\"\u003e\n\u003c/p\u003e\n\n**Features:**\n- Captures `UIViewAlertForUnsatisfiableConstraints` breakpoint output\n- Parses conflicting constraint sets into readable format\n- Shows which views and constraints are involved\n- Suggests which constraint to remove or lower priority\n\n---\n\n### 🔔 Push Notification Tester\n\nSimulate and test push notifications locally without a backend or APNs configuration.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/push-notifications/push-notifications.png\" width=\"300\" alt=\"Push Notification Tester\"\u003e\n\u003c/p\u003e\n\n**Features:**\n- Create custom notification payloads (title, body, badge, sound)\n- Schedule local notifications with configurable delay\n- Test deep link routing from notification taps\n- Preview notification appearance before sending\n\n---\n\n### 🔗 Deeplink Tester\n\nTest URL schemes and universal links without leaving the app.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Resources/images/phantom-swift-ui/deeplink-tester/deeplink-tester.png\" width=\"300\" alt=\"Deeplink Tester\"\u003e\n\u003c/p\u003e\n\n**Features:**\n- Input any URL scheme or universal link\n- Execute deep links within the app context\n- History of recently tested links\n- Quick-access bookmarks for frequently tested routes\n\n---\n\n### 🖥 Remote WebSocket Server\n\nStart a WebSocket server on the device. Connect from any WebSocket client (browser, Postman, custom tool) and query your app’s state in real time.\n\n```swift\n#if DEBUG\nif #available(iOS 13.0, *) {\n    PhantomRemoteServer.shared.start(port: 9876)\n}\n// Connect from browser: ws://\u003cdevice-ip\u003e:9876\n// Send JSON: {\"command\": \"logs\"} or {\"command\": \"network-trace\"}\n#endif\n```\n\n**Available Commands:**\n\n| Command | Description |\n|---------|-------------|\n| `app-info` | App bundle info, device model, iOS version |\n| `system-status` | CPU, memory, disk usage |\n| `logs` | Last 50 log entries |\n| `network-trace` | Last 50 network requests |\n| `feature-flags` | All registered feature flags |\n| `toggle-flag` | Toggle a feature flag (params: `key`) |\n| `performance` | Current metrics + 30-sample history |\n| `clear-logs` | Clear the log store |\n| `clear-network` | Clear captured network requests |\n| `help` | List available commands |\n\nA built-in web echo page is included at `Resources/web-echo/index.html` for quick browser-based testing.\n\n---\n\n## Architecture\n\n```\nSources/PhantomSwift/\n├── Core/                           # Framework core\n│   ├── PhantomSwift.swift          # Main entry point \u0026 setup\n│   ├── PhantomFeature.swift        # Feature enum (25 cases)\n│   ├── PhantomEventBus.swift       # Thread-safe event system\n│   ├── PhantomConfig.swift         # Configuration struct\n│   ├── PhantomEnvironment.swift    # Environment enum\n│   └── PhantomPlugin.swift         # Plugin protocol\n├── HUD/                            # Dashboard \u0026 presentation\n│   ├── PhantomDashboardVC.swift    # Niagara-style A→Z dashboard\n│   ├── PhantomTheme.swift          # Glassmorphic design tokens\n│   ├── PhantomHUDWindow.swift      # Overlay window management\n│   ├── PhantomGestureHandler.swift # Shake/Dynamic Island trigger\n│   └── PhantomDynamicIsland.swift  # Dynamic Island floating pill\n├── Modules/                        # Feature modules\n│   ├── Network/                    # Network trace, waterfall, HAR, replay\n│   ├── Interceptor/                # Request mocking \u0026 redirection\n│   ├── Logger/                     # Console logger with levels \u0026 tags\n│   ├── Performance/                # CPU/FPS/RAM monitor \u0026 timeline\n│   ├── MemoryLeak/                 # Leak tracker \u0026 object graph\n│   ├── UIInspector/                # UI inspection \u0026 3D hierarchy\n│   ├── Storage/                    # UserDefaults, Keychain, SQLite, Sandbox\n│   ├── QA/                         # Bug reporter, macro recorder, shortcuts\n│   ├── Security/                   # Security audit \u0026 checks\n│   ├── Analytics/                  # Analytics event interceptor\n│   ├── SwiftUI/                    # Render body tracker\n│   ├── FeatureFlags/               # Feature flag management\n│   ├── MainThreadChecker/          # Background thread violation detection\n│   ├── RuntimeBrowser/             # ObjC runtime introspection\n│   ├── Assets/                     # Asset inspector \u0026 optimization\n│   ├── Remote/                     # WebSocket debug server\n│   └── Core/                       # Extension bus \u0026 shared module utils\n└── Shared/                         # Shared utilities\n    ├── Components/                 # Reusable UI (PhantomTableVC, badges, code view)\n    ├── Extensions/                 # UIColor+Phantom, UIFont+Phantom, etc.\n    └── Helpers/                    # Swizzler, formatters, utilities\n```\n\n### Design Patterns\n\n| Pattern | Usage |\n|---------|-------|\n| **Singletons** | Module managers (`PhantomLog.shared`, `PhantomFeatureFlags.shared`) |\n| **Event Bus** | `PhantomEventBus` for decoupled module communication |\n| **Thread Safety** | `DispatchQueue(attributes: .concurrent)` with `.barrier` writes |\n| **Base VC** | `PhantomTableVC` for consistent list UIs across modules |\n| **Theme System** | `PhantomTheme` for centralized styling — never hardcode colors |\n| **Swizzler** | `PhantomSwizzler` for safe method swizzling |\n\n---\n\n## Configuration\n\n```swift\nPhantomSwift.configure { config in\n    // Environment (default: .dev)\n    config.environment = .dev       // .dev | .staging | .release\n\n    // Dashboard triggers\n    config.triggers = [.shake, .dynamicIsland]\n\n    // Theme\n    config.theme = .dark            // .dark | .light | .auto\n\n    // Custom QA shortcuts\n    config.shortcuts = [\n        AppShortcut(title: \"Reset Onboarding\") {\n            UserDefaults.standard.removeObject(forKey: \"hasSeenOnboarding\")\n        },\n        AppShortcut(title: \"Force Crash\") {\n            fatalError(\"Debug crash triggered\")\n        }\n    ]\n}\n```\n\n### Configuration Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `environment` | `PhantomEnvironment` | `.dev` | Current build environment |\n| `triggers` | `[PhantomTrigger]` | `[.shake]` | How to open the dashboard |\n| `theme` | `PhantomThemeMode` | `.dark` | UI theme mode |\n| `shortcuts` | `[AppShortcut]` | `[]` | Custom QA actions in dashboard |\n\n---\n\n## Requirements\n\n| Requirement | Minimum |\n|-------------|---------|\n| iOS | 12.0+ |\n| Swift | 5.9+ |\n| Xcode | 15.0+ |\n| Dependencies | None |\n\n\u003e **iOS Compatibility Notes:**\n\u003e - **iOS 12–12.x:** Core functionality works. SF Symbols replaced with text/Menlo fallbacks.\n\u003e - **iOS 13+:** Full SF Symbols, `UINavigationBarAppearance`, monospaced digit fonts.\n\u003e - **iOS 13+:** Remote WebSocket Server requires `Network.framework` (`NWListener`).\n\u003e - **iOS 14+:** OSLog bridge for unified logging.\n\u003e\n\u003e **Swift Compatibility Notes:**\n\u003e - **Swift 5.x:** PhantomSwift is maintained in the Swift 5 family.\n\u003e - **Swift 5.9+:** Current package manifest, CocoaPods spec, CI verification, and documentation are validated against Swift 5.9+ toolchains.\n\n---\n\n## Contributing\n\nContributions are welcome! Please follow these guidelines:\n\n1. **Fork** the repository\n2. Create a **feature branch**: `git checkout -b feature/my-feature`\n3. **Commit** with clear messages: `git commit -m \"Add: macro recorder export as JSON\"`\n4. **Push** to your fork: `git push origin feature/my-feature`\n5. Open a **Pull Request**\n\n### Code Standards\n\n- Wrap ALL code in `#if DEBUG` / `#endif`\n- Use `PhantomTheme.shared` for colors/fonts — never hardcode\n- Use `[weak self]` in closures that may outlive the caller\n- No force unwraps (`!`) — use `guard`/`if let`\n- Use `PhantomSwizzler` for method swizzling\n- Prefix public types with `Phantom`\n- Build UI programmatically — no storyboards or XIBs\n- Use `NSLayoutConstraint.activate([...])` for Auto Layout\n- Wrap iOS 13+ APIs in `if #available(iOS 13.0, *)`\n\n---\n\n## License\n\nPhantomSwift is released under the **MIT License**. See [LICENSE](LICENSE) for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eBuilt with precision for iOS engineers who demand the best debugging tools.\u003c/sub\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynaptode%2Fphantomswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynaptode%2Fphantomswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynaptode%2Fphantomswift/lists"}