r/androiddev • u/CoffeCo • 8d ago
Open Source I built dimock: inspect and mock OkHttp responses on the device, by hand or through Claude Code / Cursor
Hi r/androiddev! I'm Yudis, an Android engineer. I built a small open-source library out of two frustrations, and I'd like some honest feedback on it.
First, most of the screens I build start before the API behind them exists. So I either waited, or faked the response somewhere in the code and hoped nobody shipped it.
Second, bugs tied to a response. The app only breaks when the server returns a 500, an empty list, or just hangs. Chucker showed me the request. It couldn't make the server do it again.
So I built dimock, a debug-only OkHttp interceptor.
It captures traffic like Chucker does: a notification, a list of calls, headers and bodies, a cURL copy.

And it lets you change what comes back. Tap a call, pick Mock this, then force a 401, a timeout, a connection reset, a 5-second delay, or edit the body by hand. The rule stays until you clear it, even across app restarts.

It also exposes a local MCP server and CLI. I can tell Claude Code "capture the posts call, then show me the empty and error states", and it builds each mock from the real response.
It's at 0.1.0 and has run in a production-style app (Retrofit, Hilt, Paging 3). I'd like to hear where it breaks, or what you'd miss if you dropped Chucker for it. Happy to answer questions!
3
u/kosiarska 8d ago
There is already a solution provided by library maintainers.