{"id":17605943,"url":"https://github.com/debugswift/debugswift","last_synced_at":"2026-03-03T05:01:14.747Z","repository":{"id":212565802,"uuid":"731804628","full_name":"DebugSwift/DebugSwift","owner":"DebugSwift","description":"A toolkit to make debugging iOS applications easier 🚀","archived":false,"fork":false,"pushed_at":"2026-02-26T20:32:21.000Z","size":2076,"stargazers_count":1609,"open_issues_count":22,"forks_count":138,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-02-26T22:07:03.908Z","etag":null,"topics":["analysis","analytics","cocoapods","crashlytics","debug","debugger","debugging","hacktoberfest","layout-debugger","leak-detection","log","logs-analysis","networking","performance-analysis","sandbox","swift","swift6","ui","uikit","view"],"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/DebugSwift.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2023-12-14T23:20:18.000Z","updated_at":"2026-02-26T16:29:13.000Z","dependencies_parsed_at":"2025-12-12T02:07:15.232Z","dependency_job_id":null,"html_url":"https://github.com/DebugSwift/DebugSwift","commit_stats":null,"previous_names":["maatheusgois/newcocoadebug","maatheusgois/debugswift","debugswift/debugswift"],"tags_count":195,"template":false,"template_full_name":null,"purl":"pkg:github/DebugSwift/DebugSwift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DebugSwift%2FDebugSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DebugSwift%2FDebugSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DebugSwift%2FDebugSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DebugSwift%2FDebugSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DebugSwift","download_url":"https://codeload.github.com/DebugSwift/DebugSwift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DebugSwift%2FDebugSwift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30032355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T03:27:35.548Z","status":"ssl_error","status_checked_at":"2026-03-03T03:27:09.213Z","response_time":61,"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":["analysis","analytics","cocoapods","crashlytics","debug","debugger","debugging","hacktoberfest","layout-debugger","leak-detection","log","logs-analysis","networking","performance-analysis","sandbox","swift","swift6","ui","uikit","view"],"created_at":"2024-10-22T15:12:26.296Z","updated_at":"2026-03-03T05:01:14.735Z","avatar_url":"https://github.com/DebugSwift.png","language":"Swift","readme":"\u003ch1 align=\"center\"\u003e\nDebugSwift\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Platforms-iOS%2014.0+-blue.svg\"/\u003e\n\u003cimg src=\"https://img.shields.io/github/v/release/DebugSwift/DebugSwift?style=flat\u0026label=Swift%20Package%20Index\u0026color=red\"/\u003e    \n\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FDebugSwift%2FDebugSwift%2Fbadge%3Ftype%3Dswift-versions\"/\u003e\n\u003cimg src=\"https://img.shields.io/github/license/DebugSwift/DebugSwift?style=flat\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://trendshift.io/repositories/12656\" target=\"_blank\"\u003e\u003cimg src=\"https://trendshift.io/api/badge/repositories/12656\" alt=\"DebugSwift%2FDebugSwift | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n| | |\n|---|---|\n| \u003cimg width=\"300\" src=\"https://github.com/DebugSwift/DebugSwift/assets/31082311/3d219290-ba08-441a-a4c7-060f946683c2\" /\u003e | \u003cp align=\"left\"\u003eDebugSwift is a comprehensive toolkit designed to streamline and elevate the debugging experience for Swift-based applications. Whether you are troubleshooting issues or optimizing performance, DebugSwift offers a powerful set of features to make your debugging process more efficient and effective.\u003c/p\u003e |\n|  |  |\n\n---\n\n\u003cimg width=\"1970\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/a569b038-9058-4260-ae7c-47f3376cf629\" /\u003e\n\u003cimg width=\"1970\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/334ccefa-5951-494f-8faa-5f016d39f946\" /\u003e\n\u003cimg width=\"1970\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/246cde3c-7a14-45de-ae01-e810c42d8e65\" /\u003e\n\u003cimg width=\"1970\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/fadde188-dcba-46d8-9460-762f9be98bd6\" /\u003e\n\u003cimg width=\"1970\" height=\"1184\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/8085e55c-a7e6-4e3b-8ceb-8fc7034480fe\" /\u003e\n\u003cimg width=\"1970\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/a435a660-a4b2-4a3f-852e-a7bf0709e75e\" /\u003e\n\u003cimg width=\"1970\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/15f34de1-214f-4bc3-95bc-b25efc2d383e\" /\u003e\n\n## 📋 Table of Contents\n\n- [🚀 Features](#features)\n- [🛠 Installation \u0026 Setup](#installation--setup)\n- [🔧 Troubleshooting](#troubleshooting)\n- [📝 Examples](#examples)\n- [🔧 Configuration](#configuration)\n\n## Requirements\n\n- **iOS 14.0+**\n- **Swift 6.0+**\n- **Xcode 16.0+**\n\n## Features\n\n### 🌐 Network Inspector\n- **HTTP Monitoring:** Capture all requests/responses with detailed logs and filtering\n- **WebSocket Inspector:** Zero-config automatic monitoring of WebSocket connections and frames\n- **Request Limiting:** Set thresholds to monitor and control API usage\n- **Smart Content:** Automatic JSON formatting with syntax highlighting\n- **Encryption Support:** Automatic decryption of encrypted API responses with AES-256/128 and custom decryptors\n\n### ⚡ Performance\n- **Real-time Metrics:** Monitor CPU, memory, and FPS in real-time\n- **Memory Leak Detection:** Automatic detection of leaked ViewControllers and Views\n- **Thread Checker:** Detect main thread violations with detailed stack traces\n- **Performance Widget:** Overlay displaying live performance stats\n\n### 📱 App Tools\n- **Crash Reports:** Detailed crash analysis with screenshots and stack traces\n- **Console Logs:** Real-time console output monitoring and filtering\n- **Device Info:** App version, build, device details, and more\n- **APNS Tokens:** Easy access and copying of push notification tokens\n- **Custom Actions:** Add your own debugging actions and info\n\n### 🎨 Interface Tools\n- **Grid Overlay:** Visual alignment grid with customizable colors and opacity\n- **View Hierarchy:** 3D interactive view hierarchy inspector\n- **Touch Indicators:** Visual feedback for touch interactions\n- **Animation Control:** Slow down animations for easier debugging\n- **View Borders:** Highlight view boundaries with colorization\n- **SwiftUI Render Tracking (Beta):** Automatically detect and visualize SwiftUI view re-renders with dedicated settings screen\n\n### 📁 Resources\n- **File Browser:** Navigate app sandbox and shared app group containers\n- **UserDefaults:** View and modify app preferences at runtime\n- **Keychain:** Inspect keychain entries\n- **Database Browser:** SQLite and Realm database inspection\n- **Push Notifications:** Simulate push notifications with templates and test scenarios\n\n## Installation \u0026 Setup\n\n### 🍃 Swift Package Manager (Recommended)\n\nAdd to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/DebugSwift/DebugSwift.git\", from: \"1.0.0\")\n]\n```\n\nOr add through Xcode: `File` \u003e `Add Package Dependencies` \u003e Enter URL:\n```\nhttps://github.com/DebugSwift/DebugSwift\n```\n\n### 🎯 CocoaPods\n\n#### Option 1: Source Distribution (Standard)\nAdd to your `Podfile`:\n\n```ruby\npod 'DebugSwift'\n```\n\n#### Option 2: XCFramework Distribution (Faster Builds) ⚡\nAdd to your `Podfile`:\n\n```ruby\npod 'DebugSwift', :http =\u003e 'https://github.com/DebugSwift/DebugSwift/releases/latest/download/DebugSwift.xcframework.zip'\n```\n\n### 🍎 Apple Silicon Support\n\nDebugSwift **fully supports Apple Silicon Macs** with native arm64 simulator builds! No more architecture exclusions or compatibility issues.\n\n**Supported Architectures:**\n- 📱 **iOS Device**: arm64\n- 🖥️ **iOS Simulator**: arm64 (Apple Silicon) + x86_64 (Intel)\n\n**Migration Note:** If you were using architecture exclusions like `'EXCLUDED_ARCHS[sdk=iphonesimulator*]' =\u003e 'arm64'`, you can now **remove them** as they are no longer needed.\n\n### Basic Setup\n\n```swift\nimport DebugSwift\n\n@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n    private let debugSwift = DebugSwift()\n    \n    func application(\n        _ application: UIApplication,\n        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?\n    ) -\u003e Bool {\n        \n        #if DEBUG\n        debugSwift.setup()\n        // debugSwift.setup(disable: [.leaksDetector])\n        debugSwift.show()\n        #endif\n        \n        return true\n    }\n}\n```\n\n### Shake to Toggle (Optional)\n\n```swift\nextension UIWindow {\n    open override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {\n        super.motionEnded(motion, with: event)\n        \n        #if DEBUG\n        if motion == .motionShake {\n            if let appDelegate = UIApplication.shared.delegate as? AppDelegate {\n                appDelegate.debugSwift.toggle()\n            }\n        }\n        #endif\n    }\n}\n```\n\n## 🔧 Troubleshooting\n\n### Apple Silicon Build Issues\n\nIf you encounter build errors like `error unsupported Swift architecture` or `DebugSwift.framework only contains x86_64 slice for simulator` on Apple Silicon Macs:\n\n#### Solution 1: Update to Latest Version\nEnsure you're using the latest version of DebugSwift which includes full Apple Silicon support:\n\n```ruby\n# CocoaPods\npod 'DebugSwift', '~\u003e 1.8.1'\n\n# Swift Package Manager - update to latest\n```\n\n#### Solution 2: Use XCFramework Distribution (Recommended)\nFor faster builds and guaranteed architecture compatibility:\n\n```ruby\npod 'DebugSwift', :http =\u003e 'https://github.com/DebugSwift/DebugSwift/releases/latest/download/DebugSwift.xcframework.zip'\n```\n\n#### Solution 3: Remove Architecture Exclusions\nIf you have custom architecture exclusions in your project, remove them:\n\n```ruby\n# Remove this from your Podfile or target configuration:\n# config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'\n```\n\n#### Solution 4: Clean Build\nClean your build folder and derived data:\n\n```bash\n# Xcode\nProduct → Clean Build Folder (⌘⇧K)\n\n# Command line\nrm -rf ~/Library/Developer/Xcode/DerivedData\n```\n\n### Build Performance\n\n- **XCFramework Distribution**: Up to 50% faster build times\n- **Source Distribution**: Full source access and debugging capabilities\n\nChoose XCFramework for production builds, source for active development.\n\n## Examples\n\n### Enhanced Hierarchy Tree for Deeper Application Insights (Beta)\nHarness the Power of Visual Information within the iOS Hierarchy Tree to Uncover Intricate Layouts and Element Relationships in Your Application.\n\n#### How to Use\nSimply press and hold the circle button to reveal the Snapshot and Hierarchy for a comprehensive overview.\n\n#### Results:\n![image8](https://github.com/DebugSwift/DebugSwift/assets/31082311/fdc117a2-e9f9-4246-9e9e-fcae818b7ea1)\n\n#### Explore Additional Details\n\nEnhance your understanding by pressing and holding on a specific view to reveal information such as:\n- Class\n- Subviews\n- Background Color\n- Specific attributes based on the type (e.g., UILabel: Text, Font, and TextColor).\n\n#### Results:\n![image10](https://github.com/DebugSwift/DebugSwift/assets/31082311/7e9c3a8b-3d26-4b7c-b671-1894cb32e562)\n\n### App Custom ViewControllers in Tab Bar\n\n```swift\nDebugSwift.App.shared.customControllers = {\n    let controller1 = UITableViewController()\n    controller1.title = \"Custom TableVC 1\"\n\n    let controller2 = UITableViewController()\n    controller2.title = \"Custom TableVC 2\"\n    return [controller1, controller2]\n}\n```\n\n### Custom Debug Actions\n\n```swift\n// Add custom debugging actions\nDebugSwift.App.shared.customAction = {\n    [\n        .init(title: \"Development Tools\", actions: [\n            .init(title: \"Clear User Data\") {\n                UserDefaults.standard.removeObject(forKey: \"userData\")\n            },\n            .init(title: \"Reset App State\") {\n                // Your reset logic here\n            }\n        ])\n    ]\n}\n```\n\n#### Results:\n![image6](https://github.com/DebugSwift/DebugSwift/assets/31082311/f9c23835-e17e-49a8-b971-4b9880403b15)\n\n### App Custom Data\n\n```swift\nDebugSwift.App.shared.customInfo = {\n    [\n        .init(\n            title: \"Info 1\",\n            infos: [\n                .init(title: \"title 1\", subtitle: \"title 2\")\n            ]\n        )\n    ]\n}\n```\n\n#### Results:\n![image5](https://github.com/DebugSwift/DebugSwift/assets/31082311/2a38e758-1418-4f14-805f-432d124ad071)\n\n### APNS Token Integration\n\n```swift\n// In your AppDelegate\nfunc application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {\n    DebugSwift.APNSToken.didRegister(deviceToken: deviceToken)\n    // Your existing token handling code\n}\n\nfunc application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {\n    DebugSwift.APNSToken.didFailToRegister(error: error)\n    // Your existing error handling code\n}\n```\n\n## Configuration\n\n### Network Filtering\n\n```swift\n// Ignore specific URLs\nDebugSwift.Network.shared.ignoredURLs = [\"https://analytics.com\"]\n\n// Monitor only specific URLs\nDebugSwift.Network.shared.onlyURLs = [\"https://api.myapp.com\"]\n```\n\n### Network History Management\n\n```swift\n// Clear HTTP/HTTPS request history (useful when switching environments)\nDebugSwift.Network.shared.clearNetworkHistory()\n\n// Clear WebSocket connection history\nawait DebugSwift.Network.shared.clearWebSocketHistory()\n\n// Clear all network data (HTTP + WebSocket)\nawait DebugSwift.Network.shared.clearAllNetworkData()\n\n// Example: Clear network data when switching environments\nDebugSwift.App.shared.customAction = {\n    [\n        .init(title: \"Environment\", actions: [\n            .init(title: \"Switch to Production\") {\n                // Your environment switch logic\n                DebugSwift.Network.shared.clearNetworkHistory()\n            },\n            .init(title: \"Switch to Development\") {\n                // Your environment switch logic\n                DebugSwift.Network.shared.clearNetworkHistory()\n            }\n        ])\n    ]\n}\n```\n\n### Manual URLSessionConfiguration Injection\n\nIf you create `URLSessionConfiguration` instances **before** calling `DebugSwift.setup()`, you can manually inject the network monitoring protocol:\n\n```swift\n// Option 1: Inject into existing configuration\nlet config = URLSessionConfiguration.default\nDebugSwift.Network.shared.injectIntoConfiguration(config)\nlet session = URLSession(configuration: config)\n\n// Option 2: Get pre-configured default configuration\nlet config = DebugSwift.Network.shared.defaultConfiguration()\nlet session = URLSession(configuration: config)\n\n// Option 3: Get pre-configured ephemeral configuration\nlet config = DebugSwift.Network.shared.ephemeralConfiguration()\nlet session = URLSession(configuration: config)\n\n// Option 4: Direct protocol class injection (advanced)\nvar config = URLSessionConfiguration.default\nvar protocolClasses = config.protocolClasses ?? []\nprotocolClasses.insert(CustomHTTPProtocol.self, at: 0)\nconfig.protocolClasses = protocolClasses\n```\n\n**Note:** This is particularly useful when migrating from other network debugging tools like Netfox or when working with pre-existing URLSession configurations.\n\n### Network Encryption/Decryption\n\nDebugSwift supports automatic decryption of encrypted API responses, making it easier to debug apps with end-to-end encryption.\n\n```swift\n// Enable decryption feature\nDebugSwift.Network.shared.setDecryptionEnabled(true)\n\n// Register decryption key for specific API endpoints\nif let key = \"your-32-byte-aes-key-here-123456\".data(using: .utf8) {\n    DebugSwift.Network.shared.registerDecryptionKey(for: \"api.example.com\", key: key)\n}\n\n// Register custom decryptor for complex encryption schemes\nDebugSwift.Network.shared.registerCustomDecryptor(for: \"api.myapp.com\") { encryptedData in\n    // Your custom decryption logic here\n    return customDecrypt(encryptedData)\n}\n```\n\n### Selective Features\n\n```swift\ndebugSwift.setup(\n    hideFeatures: [.performance, .interface], // Hide specific tabs\n    disable: [.leaksDetector, .console]       // Disable specific monitoring\n)\n```\n\n### Beta Features\n\n```swift\n// Enable beta features (disabled by default)\ndebugSwift.setup(\n    enableBetaFeatures: [.swiftUIRenderTracking] // Enable experimental SwiftUI render tracking\n)\n```\n\n### App Group Configuration\n\n```swift\n// Configure app groups for file browser access\nDebugSwift.Resources.shared.configureAppGroups([\n    \"group.com.yourcompany.yourapp\"\n])\n```\n\n### Performance Monitoring\n\n```swift\n// Configure memory leak detection\nDebugSwift.Performance.shared.onLeakDetected { leakData in\n    print(\"🔴 Memory leak detected: \\(leakData.message)\")\n}\n```\n\n### Push Notification Simulation\n\n```swift\n// Enable push notification simulation\nDebugSwift.PushNotification.enableSimulation()\n\n// Simulate a notification\nDebugSwift.PushNotification.simulate(\n    title: \"Test Notification\",\n    body: \"This is a test notification\"\n)\n```\n\n### SwiftUI Render Tracking (Beta)\n\n⚠️ **Beta Feature**: SwiftUI render tracking is experimental and must be enabled explicitly.\n\n```swift\n// First enable the beta feature in setup\ndebugSwift.setup(enableBetaFeatures: [.swiftUIRenderTracking])\n\n// Then enable SwiftUI render tracking\nDebugSwift.SwiftUIRender.shared.isEnabled = true\n\n// Configure persistent overlays (stay visible until manually cleared)\nDebugSwift.SwiftUIRender.shared.persistentOverlays = true\n\n// Set overlay style (border, borderWithCount, none)\nDebugSwift.SwiftUIRender.shared.overlayStyle = .borderWithCount\n\n// Configure overlay duration\nDebugSwift.SwiftUIRender.shared.overlayDuration = 1.0\n\n// Enable console logging\nDebugSwift.SwiftUIRender.shared.loggingEnabled = true\n\n// Clear render statistics\nDebugSwift.SwiftUIRender.shared.clearStats()\n\n// Clear persistent overlays\nDebugSwift.SwiftUIRender.shared.clearPersistentOverlays()\n```\n\n---\n\n## ⭐ Support the Project\n\nIf you find DebugSwift helpful, please consider giving us a star on GitHub! Your support helps us continue improving and adding new features.\n\n[![GitHub stars](https://img.shields.io/github/stars/DebugSwift/DebugSwift.svg?style=social\u0026label=Star)](https://github.com/DebugSwift/DebugSwift)\n\n## Contributors\n\nOur contributors have made this project possible. Thank you!\n\n\u003ca href=\"https://github.com/DebugSwift/DebugSwift/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=DebugSwift/DebugSwift\" /\u003e\n\u003c/a\u003e\n\n## Contributing\n\nContributions are welcome! If you have suggestions, improvements, or bug fixes, please submit a pull request. Let's make DebugSwift even more powerful together!\n\n## Repo Activity\n\n![Alt](https://repobeats.axiom.co/api/embed/53a4d8a27ad851f52451b14b9a1671e7124f88e8.svg \"Repobeats analytics image\")\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=DebugSwift/DebugSwift\u0026type=Date)](https://star-history.com/#DebugSwift/DebugSwift\u0026Date)\n\n## License\n\nDebugSwift is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## References\n\n- [InAppViewDebugger](https://github.com/indragiek/InAppViewDebugger) \n- [CocoaDebug](https://github.com/CocoaDebug/CocoaDebug) \n- [DBDebugToolkit](https://github.com/dbukowski/DBDebugToolkit)\n- [LeakedViewControllerDetector](https://github.com/Janneman84/LeakedViewControllerDetector)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebugswift%2Fdebugswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebugswift%2Fdebugswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebugswift%2Fdebugswift/lists"}