gitmyhub

chucker

Kotlin ★ 4.5k updated 1d ago

🔎 An HTTP inspector for Android & OkHTTP (like Charles but on device)

A two-line-to-add Android debugging library that captures every network request and response your app makes and displays them on-device via a notification, with zero footprint in production builds.

KotlinAndroidOkHttpGradlesetup: easycomplexity 2/5

Chucker is a debugging tool for Android app developers that lets them inspect the network requests and responses their app makes, directly on the device. When an app sends data over the internet or receives a response from a server, Chucker captures and records those exchanges. It then displays a notification summarizing what happened, and tapping that notification opens a full screen view where you can read the details of each request and response: the URL, headers, status codes, response times, and body content.

The tool works by plugging into OkHttp, which is a widely used networking library for Android. Adding Chucker takes two lines in the app's build configuration file and one line of code to attach it to the HTTP client. From that point on, it automatically records every request the app makes through that client. No other setup is required for basic use.

A key design detail is that Chucker is meant strictly for development builds. The project includes a no-op version of the library that replaces it in release builds, which means the tool leaves no trace in the app that real users install. Developers add both variants in their build file and Chucker automatically drops out of production.

Chucker includes several configuration options for teams that need more control. You can set how long captured data is retained before being deleted. You can mark specific headers as sensitive, and Chucker will replace their values with asterisks in its display so passwords or tokens are not visible in logs. You can set a maximum body size to prevent very large responses from being stored in full. For apps that use binary data formats rather than plain text, you can write a custom decoder so Chucker can still display the content in a readable form.

Android 13 and later require apps to request permission before showing notifications, which affects how Chucker's notification appears. The README covers the two scenarios a developer might encounter and what to do in each case. The project is open source and actively maintained, with a changelog tracking updates across versions.

Where it fits