Network Inspector
The Network Inspector captures all outgoing HTTP requests from your app in real time. View HTTP method, URL, headers, request/response body, status code, response time, and timestamp -- all without modifying your backend.
Features
- Real-time capture of all HTTP traffic
- Full request and response details (headers, body, status)
- Response time measurement
- HTTP mocking for testing
HTTP Mocking
Snapbug lets you mock HTTP responses directly from the inspector, without touching your backend or writing test code.
Use cases:
- Simulate errors -- test how your app handles 500s, timeouts, or malformed responses
- Create test data -- return custom JSON payloads for specific endpoints
- Mock from existing requests -- duplicate a captured request and modify its response
- Reduce dependencies -- develop features before the backend is ready
Mocks are applied on the device side via the interceptor. No proxy or server changes are needed.
Setup
The OkHttp and Ktor integrations ship inside the all-in-one Android SDK. With the standard pair from Android SDK in place, add no extra dependency:
dependencies {
debugImplementation("ai.snapbug:snapbug:1.0.4")
releaseImplementation("ai.snapbug:snapbug-no-op:1.0.4")
}Do not add snapbug-okhttp-interceptor or snapbug-ktor-interceptor next to the all-in-one. In release they land next to their no-op twins and the build fails with Duplicate class.
The SDK cannot see HTTP traffic on its own, so hook each client your app builds. Choose the snippet that matches your HTTP client.
Add the interceptor as the last addInterceptor call, so it sees the final request headers (auth and others). Use addInterceptor, not addNetworkInterceptor. This also covers Retrofit, Coil and Glide when they use this client. If a DI module (Hilt, Koin, Dagger) provides the OkHttpClient, edit that provider.
import io.snapbug.sdk.okhttp.SnapbugOkhttpInterceptor
val client = OkHttpClient.Builder()
.addInterceptor(authInterceptor) // existing interceptors stay first
.addInterceptor(SnapbugOkhttpInterceptor()) // Snapbug goes after them
.build()In release builds snapbug-no-op provides the same classes with no behavior, so the code above compiles unchanged and adds zero overhead in production.
Flutter, React Native and iOS
Network capture on the other platforms:
- Flutter -- add the
SnapbugDioInterceptorto your Dio client (see Flutter). - React Native -- call
patchFetch()once at startup to capture allfetchtraffic (see React Native). Onlyfetchis patched: axios usesXMLHttpRequestby default, so its calls appear only if you setadapter: 'fetch'. - iOS (Swift) --
URLSessiontraffic is not captured automatically: route requests throughSnapbugURLSession.data(for:)/data(from:)(available in both theSnapbugandSnapbug-no-oppods), or hook a Kotlin Multiplatform Ktor client (see iOS SDK).