Skip to content

Debug Tools

Lopez Mikhael edited this page Oct 12, 2020 · 2 revisions
Type Name
Logs Timber
HTTP requests Chuck
Database Inspector Stetho
Dependencies version Gradle versions plugin
Log Unit Tests Gradle test logger plugin

Don't forget to remove your debug logs on your application in production. You probably already know this library, if it's not the case I strongly invite you to use it.

Chuck is a simple in-app HTTP inspector for Android OkHttp clients. Chuck intercepts and persists all HTTP requests and responses inside your application. It also provides UI for inspecting their content.

Stetho is a powerful library created by Facebook with many tools. I mainly use it when I need to analyze the database.

To do this, inspect your device on chrome with the following link: chrome://inspect/#devices

However, since version 4.1 of Android Studio we are lucky to have a Database Inspector tool directly integrated into the IDE which allows us to do the same but more easily:

This is probably the plugin I use the most. It allows in a command line to check that the libraries currently used in the application are up to date.

 ./gradlew dependencyUpdates

You can also configure the update strategy to keep only release versions this way:

dependencyUpdatesStrategy = {
    componentSelection { rules ->
        rules.all { ComponentSelection selection ->
            boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
                selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
            }
            if (rejected) {
                selection.reject('Release candidate')
            }
        }
    }
}

Last but not least, this plugin improves the display of your unit test results.
It is very practical especially when you have to analyze the results in CI.