Home | Deeplink | Log | Network |
---|---|---|---|
A comprehensive tool designed to assist developers in debugging and optimizing their applications.
DeveloperSuite offers an array of detailed information on various aspects of the application; Developers can easily access crucial information pertaining to the application's performance and functionality, facilitating identification and resolution of any issues.
- Bundle
- Info.plist
- Deeplink
- Deeplink Logging (no code required)
- Device
- MachO
- MobileGestalt.plist
- ProcessInfo
- Log
- Native
- Support for SwiftLog backend
- Network
- URLSession Logging (no code required)
- URLSession.shared Logging (no code required)
- Automatically supports URLSession based frameworks like Alamofire
- Notification
- UserDefaults
- Permission
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
You can add DeveloperSuite to an Xcode project by adding it as a package dependency.
-
In your Xcode project, navigate to File > Swift Packages > Add Package Dependency
-
Paste the following into the URL field: https://github.com/wynioux/DeveloperSuite/
Follow these steps to add URL Types to your iOS app:
- Open your Xcode project.
- Select your app target from the project navigator.
- Go to the "Info" tab.
- Look for the "URL Types" section.
- If there are no URL Types defined, click the "+" button to add a new URL Type.
-
In the URL Schemes field, enter a unique identifier for your app's custom URL scheme. This scheme will be used to launch your app from other apps or web links. For example, if your app's name is "YourAppName", you can use "yourappname" as the URL scheme.
-
Save your changes.
To collect network logs using DeveloperSuite
in your iOS app, follow these steps:
-
First, make sure you have integrated
DeveloperSuite
into your Xcode project. If you haven't, follow the installation instructions provided in the repository. -
In your Xcode project, navigate to the
@main
struct of your app. This is typically located in theYourAppName.swift
file. -
Import the
DeveloperSuite
module at the top of the file:
import DeveloperSuite
- Inside the
@main
struct, add the following lines in theinit()
method:
@main
struct YourAppNameApp: App {
init() {
// Enable URLProtocolMiddleware to collect `URLSession.shared` network logs
URLProtocolMiddleware.shared.enable()
// Enable URLSessionDelegateMiddleware to collect `URLSession` with delegate network logs
URLSessionDelegateMiddleware.enable()
}
// Your app's entry point and other code...
}
- To log decoding errors in network responses, you need to implement the
NetworkLogger.log(_:didFinishDecodingWithError:)
function from DeveloperSuite.
Here's an example Alamofire implementation:
import Alamofire
import DeveloperSuite
import Foundation
final class DeveloperSuiteEventMonitor: EventMonitor {
let networkLogger = NetworkLogger.default
func request<Value>(_ request: DataRequest, didParseResponse response: DataResponse<Value, AFError>) {
guard let task = request.task else { return }
networkLogger.log(task, didFinishDecodingWithError: response.error?.underlyingError)
}
}
import Alamofire
import Foundation
final class NetworkService {
let session = Session(eventMonitors: [DeveloperSuiteEventMonitor()])
...
}
- You can open DeveloperSuite using deep links in two ways:
Type the following URL in Safari, Notes, or any other app that supports URL linking:
yourappname://suite
Replace "yourappname" with your actual app's custom URL scheme.
- In-App
In your app, you can programmatically open DeveloperSuite using the following code:
if let url = URL(string: "yourappname://suite") {
UIApplication.shared.open(url)
}
Replace "yourappname" with your actual app's custom URL scheme.
- Open Other Modules with Deep Links:
To open other modules, replace the last part of the URL with the desired module name. Here are the available options:
- Bundle: "yourappname://suite/bundle"
- Deeplink: "yourappname://suite/deeplink"
- Device: "yourappname://suite/device"
- Log: "yourappname://suite/log"
- Notification: "yourappname://suite/notification"
- UserDefaults: "yourappname://suite/userdefaults"
- Permission: "yourappname://suite/permission"
- Settings: "yourappname://suite/settings"
That's it! Now users can open DeveloperSuite
using deep links either by typing the URL directly or using UIApplication.shared.open(url)
in your app. Enjoy exploring the network logs and debugging your app with ease!
Swift | Platforms |
---|---|
Swift 5.7 | iOS 15.0, iPadOS 15.0 |
This Swift package is heavily inspired by the fantastic work of Pulse by Kean, which served as a valuable source of inspiration and reference for the development of this project.
If you find this package helpful, we encourage you to check out the original project, Pulse, and support its development as well.
DeveloperSuite is released under the MIT license. See LICENSE for details.