- Crash Reports: Access detailed crash reports for analysis and debugging.
- Change Location: Simulate different locations for testing location-based features.
- Console: Monitor and interact with the application's console logs.
- Custom Info: Add custom information for quick access during debugging.
- Version: View the current application version.
- Build: Identify the application's build number.
- Bundle Name: Retrieve the application's bundle name.
- Bundle ID: Display the unique bundle identifier for the application.
- Device Infos: Access information about the device running the application.
- Grid: Overlay a grid on the interface to assist with layout alignment.
- Slow Animations: Slow down animations for better visualization and debugging.
- Showing Touches: Highlight touch events for easier interaction tracking.
- Colorized View with Borders: Apply colorization and borders to views for improved visibility.
- All Response/Request Logs: Capture and review detailed logs of all network requests and responses.
- CPU, Memory, FPS: Monitor and analyze CPU usage, memory consumption, and frames per second in real-time.
- Keychain: Inspect and manage data stored in the keychain.
- User Defaults: View and modify user defaults for testing different application states.
- Files: Access and analyze files stored by the application.
Add the following line to your Podfile
:
pod 'DebugSwift', :git => 'https://github.com/DebugSwift/DebugSwift.git', :branch => 'main'
Then, run:
pod install
Add the following dependency to your Package.swift
file:
.package(url: "https://github.com/DebugSwift/DebugSwift.git", from: "main")
Then, add "DebugSwift"
to your target's dependencies.
func application(
_: UIApplication,
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
DebugSwift.setup()
DebugSwift.show()
return true
}
extension UIWindow {
open override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
super.motionEnded(motion, with: event)
if motion == .motionShake {
DebugSwift.toggle()
}
}
}
If you want to ignore specific URLs, use the following code:
DebugSwift.Network.ignoredURLs = ["https://reqres.in/api/users/23"]
If you want to capture only a specific URL, use the following code:
DebugSwift.Network.onlyURLs = ["https://reqres.in/api/users/23"]
Adjust the URLs in the arrays according to your needs.
DebugSwift.App.customInfo = {
[
.init(
title: "Info 1",
infos: [
.init(title: "title 1", subtitle: "title 2")
]
)
]
}
DebugSwift.App.customAction = {
[
.init(
title: "Action 1",
actions: [
.init(title: "action 1") { [weak self] in // Important if use self
print("Action 1")
}
]
)
]
}
Contributions are welcome! If you have suggestions, improvements, or bug fixes, please submit a pull request. Let's make DebugSwift even more powerful together!
DebugSwift is licensed under the MIT License - see the LICENSE file for details.