This library provides an on-device solution for obtaining and displaying debug information related to the app, with options to export data as needed. It is enabled exclusively for DEBUG builds, while a no-op version is available for RELEASE variants. Designed to assist both developers and QA teams, it streamlines issue reporting and diagnostics during development and testing. A key advantage of this library is that all debugging insights are accessible directly on the device, eliminating the need for external tools.
The information collected, stored and shared MAY contain sensitive information and/or impact the privacy policy of the app. This library should STRICTLY be used only for debugging purposes, and NEVER in production.
The debug information collected and reported include:
- Network traffic
- Logcat output
- Summary of Room Database storage
- Shared preferences
- Status of network, power, and audio systems
The recorded information is persisted on the device, ensuring availability even after a crash. Note: To prevent excessive growth, older entries will be periodically purged.
The library uses an ASM based gradle plugin to intercept OkHTTP traffic (no need to add Interceptors manually).
Add to repositories
repositories {
maven { url = uri("https://jitpack.io") }
}
Add to root project gradle file
plugins {
id("com.sandymist.mobile.plugin.interceptor") version "0.1.3" apply false
}
Add to app gradle file as follows
plugins {
id("com.sandymist.mobile.plugin.interceptor")
}
interceptor {
targetClassName = "com.sandymist.mobile.plugins.network.NetworkPlugin"
}
dependencies {
debugImplementation("com.github.sandymist.android-debug-library:debuglib-debug:<version>")
releaseImplementation("com.github.sandymist.android-debug-library:debuglib-no-op:<version>")
}
Integrate Debug menu into the app's UI.
DebugLib.init(this)
Option 1: Call the composable function directly.
import com.sandymist.android.debuglib.ui.DebugScreen
DebugScreen(modifier: Modifier)
Option 2: Launch the DebugActivity (non-Jetpack-Compose apps)
import com.sandymist.android.debuglib.ui.DebugActivity
val intent = Intent(context, DebugActivity::class.java)
context.startActivity(intent)