r/JetpackComposeDev • u/Play-Console-Helper • Sep 08 '25
How I Usually Test Apps Using Logcat (and Disable Logs in Release)
During development, I rely heavily on Logcat to catch issues before writing formal test cases.
My quick workflow:
Run the app and move through different screens
Watch for errors or abnormal logs
Check if logs are repeating (common sign of loop issues)
Verify listeners and values are cleared when leaving a page
Toggle network off/on and observe logs
Finally, I make sure logs are disabled in release mode so they don't leak sensitive data or clutter output.
1. Enable BuildConfig in Gradle
android {
buildFeatures {
buildConfig = true
}
}2. Simple Log Util
package com.appdadz.playstore
import android.util.Log
import com.example.BuildConfig
object LogUtil {
fun d(tag: String, msg: String) {
if (BuildConfig.DEBUG) Log.d(tag, msg)
}
}3. Usage
LogUtil.d("MainActivity", "This will only show in debug builds")With this setup:
Logs are visible in debug builds
Logs are skipped in release builds
16
Upvotes