{"id":13614946,"url":"https://github.com/DebugSwift/DebugSwift","last_synced_at":"2025-04-13T20:32:32.436Z","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":"2024-09-22T20:40:26.000Z","size":1358,"stargazers_count":468,"open_issues_count":21,"forks_count":47,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2024-11-05T06:10:32.849Z","etag":null,"topics":["analysis","analytics","cocoapods","crashlytics","debug","debugger","debugging","hacktoberfest","layout-debugger","leak-detection","log","logs-analysis","networking","performance-analysis","qa","sandbox","swift","ui","uikit","view"],"latest_commit_sha":null,"homepage":"https://cocoapods.org/pods/DebugSwift","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}},"created_at":"2023-12-14T23:20:18.000Z","updated_at":"2024-11-04T14:06:38.000Z","dependencies_parsed_at":"2023-12-23T17:10:46.826Z","dependency_job_id":"7598146a-9c38-4436-a3bc-a33ffd045352","html_url":"https://github.com/DebugSwift/DebugSwift","commit_stats":null,"previous_names":["maatheusgois/newcocoadebug","maatheusgois/debugswift","debugswift/debugswift"],"tags_count":81,"template":false,"template_full_name":null,"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/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223605480,"owners_count":17172496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","qa","sandbox","swift","ui","uikit","view"],"created_at":"2024-08-01T20:01:07.344Z","updated_at":"2024-11-07T23:30:33.954Z","avatar_url":"https://github.com/DebugSwift.png","language":"Swift","readme":"# DebugSwift\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Platforms-iOS%2012.0+-blue.svg\"/\u003e\n\u003cimg src=\"https://img.shields.io/github/v/release/DebugSwift/DebugSwift?style=flat\u0026label=CocoaPods\"/\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\n| \u003cimg width=\"300\" src=\"https://github.com/DebugSwift/DebugSwift/assets/31082311/3d219290-ba08-441a-a4c7-060f946683c2\"\u003e | \u003cdiv align=\"left\" \u003eDebugSwift is a comprehensive toolkit designed to simplify and enhance the debugging process for Swift-based applications. Whether you're troubleshooting issues or optimizing performance, DebugSwift provides a set of powerful features to make your debugging experience more efficient.\u003c/div\u003e |\n|---|---|\n\n![image1](https://github.com/DebugSwift/DebugSwift/assets/31082311/03d0e0d0-d2ab-4fc2-8d47-e7089fffc2f6)\n![image2](https://github.com/DebugSwift/DebugSwift/assets/31082311/994e75c9-948e-486b-9522-4e2a9779de4e)\n![image3](https://github.com/DebugSwift/DebugSwift/assets/31082311/0aebb4ce-3e0c-4eea-b2a4-4516d916228e)\n![image4](https://github.com/DebugSwift/DebugSwift/assets/31082311/fecff545-405b-493f-99f8-3ed65d453227)\n![image5](https://github.com/DebugSwift/DebugSwift/assets/31082311/7e558c50-6634-4e26-9788-b1b355f121f4)\n![image6](https://github.com/DebugSwift/DebugSwift/assets/31082311/d0512b4e-afbd-427f-b8e0-f125afb92416)\n![image11](https://github.com/DebugSwift/DebugSwift/assets/31082311/d5f36843-1f74-49b9-89ef-1875f5ae395b)\n\n## Features\n\n### App Settings\n\n- **Crash Reports:** Access detailed crash reports for analysis and debugging.\n- **Change Location:** Simulate different locations for testing location-based features.\n- **Console:** Monitor and interact with the application's console logs.\n- **Custom Info:** Add custom information for quick access during debugging.\n- **Version:** View the current application version.\n- **Build:** Identify the application's build number.\n- **Bundle Name:** Retrieve the application's bundle name.\n- **Bundle ID:** Display the unique bundle identifier for the application.\n- **Device Infos:** Access information about the device running the application.\n\n### Interface\n\n- **Grid:** Overlay a grid on the interface to assist with layout alignment.\n- **Slow Animations:** Slow down animations for better visualization and debugging.\n- **Showing Touches:** Highlight touch events for easier interaction tracking.\n- **Colorized View with Borders:** Apply colorization and borders to views for improved visibility.\n\n### Network Logs\n\n- **All Response/Request Logs:** Capture and review detailed logs of all network requests and responses.\n\n### Performance\n\n- **CPU, Memory, FPS, Memory Leak Detector:** Monitor and analyze CPU usage, memory consumption, and frames per second in real-time.\n\n### Resources\n\n- **Keychain:** Inspect and manage data stored in the keychain.\n- **User Defaults:** View and modify user defaults for testing different application states.\n- **Files:** Access and analyze files stored by the application.\n\n## Getting Started\n\n### Installation\n\n#### CocoaPods\n\nAdd the following line to your `Podfile`:\n\n```ruby\npod 'DebugSwift', :git =\u003e 'https://github.com/DebugSwift/DebugSwift.git', :branch =\u003e 'main'\n```\n\nThen, run:\n\n```bash\npod install\n```\n\n#### Swift Package Manager (SPM)\n\nAdd the following dependency to your `Package.swift` file:\n\n```swift\n.package(url: \"https://github.com/DebugSwift/DebugSwift.git\", from: \"main\")\n```\n\nThen, add `\"DebugSwift\"` to your target's dependencies.\n\n### Usage\n\n```swift\nfunc application(\n    _: UIApplication,\n    didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?\n) -\u003e Bool {\n    DebugSwift.setup()\n    DebugSwift.show()\n\n    return true\n}\n```\n\n### Usage to show or hide with shake.\n```swift\nextension UIWindow {\n    open override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {\n        super.motionEnded(motion, with: event)\n        \n        if motion == .motionShake {\n            DebugSwift.toggle()\n        }\n    }\n}\n```\n\n## Customization\n\n### Network Configuration\n\nIf you want to ignore specific URLs, use the following code:\n\n```swift\nDebugSwift.Network.ignoredURLs = [\"https://reqres.in/api/users/23\"]\n```\n\nIf you want to capture only a specific URL, use the following code:\n\n```swift\nDebugSwift.Network.onlyURLs = [\"https://reqres.in/api/users/23\"]\n```\n\nAdjust the URLs in the arrays according to your needs.\n\n### App Custom Data\n\n```swift\nDebugSwift.App.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---\n\n### App Custom Action\n\n```swift\nDebugSwift.App.customAction = {\n    [\n        .init(\n            title: \"Action 1\",\n            actions: [\n                .init(title: \"action 1\") { [weak self] in // Important if use self\n                    print(\"Action 1\")\n                }\n            ]\n        )\n    ]\n}\n```\n\n#### Results:\n![image6](https://github.com/DebugSwift/DebugSwift/assets/31082311/f9c23835-e17e-49a8-b971-4b9880403b15)\n\n---\n### App Custom ViewControllers in Tab Bar\n\n```swift\nDebugSwift.App.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---\n### Hide or disable Some Features\nIf you prefer to selectively disable certain features, DebugSwift can now deactivate unnecessary functionalities. This can assist you in development across various environments.\n\n#### Usage\n\n```swift\nfunc application(\n    _: UIApplication,\n    didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?\n) -\u003e Bool {\n\n    DebugSwift.setup(\n        // Main features\n        hideFeatures: [\n            .network,\n            .resources, \n            .performance, \n            .interface, \n            .app\n        ],\n        // Swizzle features\n        disable: [\n            .network,\n            .location, \n            .views, \n            .crashManager, \n            .leaksDetector, \n            .console\n        ]\n    )\n    DebugSwift.show()\n\n    return true\n}\n```\n#### Results:\n![image9](https://github.com/DebugSwift/DebugSwift/assets/31082311/a1261022-c193-40c9-999f-80129b34dda0)\n\n---\n\n### Collect Memory Leaks\nGet the data from memory leaks in the app.\n\n#### Usage\n\n```swift\nDebugSwift.Performance.LeakDetector.onDetect { data in\n    // If you want to send data to some analytics\n\n    print(data.message) // Retuns the name of the class and the error\n    print(data.controller) // If is an controller leak\n    print(data.view) // If is an view leak\n    print(data.isDeallocation) // If is an deallocation of leak (good for false/positive)\n}\n```\n\n#### Results:\n![image12](https://github.com/DebugSwift/DebugSwift/assets/31082311/e9acc5c5-83d4-487d-bd7e-8a66dfbc3b21)\n\n---\n### Change Appearance\nDynamic Theme: Easily Change the Interface Appearance from Dark to Light, Customize According to Your Needs.\n\n#### Usage\n\n```swift\nfunc application(\n    _: UIApplication,\n    didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?\n) -\u003e Bool {\n    DebugSwift.theme(appearance: .light)\n    DebugSwift.setup()\n    DebugSwift.show()\n\n    return true\n}\n```\n\n#### Results:\n![image7](https://github.com/DebugSwift/DebugSwift/assets/31082311/457590ce-0070-4c7a-a588-cc0825af2738)\n\n---\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\n---\n\n## Fixing Errors\n\n### Alamofire\n\n#### Not called `uploadProgress`\n\nIn the `AppDelegate`.\n\n```swift\nclass AppDelegate {\n    func application(\n        _: UIApplication,\n        didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil\n    ) -\u003e Bool {\n        DebugSwift.setup()\n        DebugSwift.show()\n\n        // Call this method\n        DebugSwift.Network.delegate = self\n        return true\n    }\n}\n```\n\nAnd conform with the protocol:\n```swift\nextension AppDelegate: CustomHTTPProtocolDelegate {\n    func urlSession(\n        _ protocol: URLProtocol,\n        _ session: URLSession,\n        task: URLSessionTask,\n        didSendBodyData bytesSent: Int64,\n        totalBytesSent: Int64,\n        totalBytesExpectedToSend: Int64\n    ) {\n\n        Session.default.session.getAllTasks { tasks in\n            let uploadTask = tasks.first(where: { $0.taskIdentifier == task.taskIdentifier }) ?? task\n            Session.default.rootQueue.async {\n                Session.default.delegate.urlSession(\n                    session,\n                    task: uploadTask,\n                    didSendBodyData: bytesSent,\n                    totalBytesSent: totalBytesSent,\n                    totalBytesExpectedToSend: totalBytesExpectedToSend\n                )\n            }\n        }\n    }\n}\n```\n\n---\n\n## ⭐ Support the Project by Leaving a Star!\n\nThank you for visiting our project! If you find our work helpful and would like to support us, please consider giving us a ⭐ star on GitHub. Your support is crucial for us to continue improving and adding new features.\n\n### Why Should You Star the Project?\n\n- **Show Your Support**: Let us know that you appreciate our efforts.\n- **Increase Visibility**: Help others discover this project.\n- **Stay Updated**: Get notifications on updates and new releases.\n- **Motivate Us**: Encouragement from the community keeps us going!\n\n### How to Leave a Star\n\n1. **Log in** to your GitHub account.\n2. **Navigate** to the top of this repository page.\n3. **Click** on the \"Star\" button located at the top-right corner.\n\nEvery star counts and makes a difference. Thank you for your support! 😊\n\n[![GitHub stars](https://img.shields.io/github/stars/DebugSwift/DebugSwift.svg?style=social\u0026label=Star)](https://github.com/DebugSwift/DebugSwift)\n\n---\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---\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---\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":["Debugging","Swift"],"sub_categories":["Getting Started"],"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"}