r/swift • u/everybodyhatesBacho • 21h ago
News I built Snitch, an open-source in-app inspector for network requests and analytics events (PostHog, AppsFlyer)
Hey r/swift,
For the past few weeks I've been working on a side project and wanted to share it here for feedback.
Snitch is a debugging tool you add to your iOS app. It shows every network request and every analytics event your app sends, right on the device. Shake the phone (or tap a floating button) and you get a timeline you can search and filter.
Why I built it: at work I kept asking "did that analytics event actually go out, and what was in it?" Answering that meant print statements, setting up a proxy, or staring at gzipped and encrypted payloads.
What it does:
- Captures URLSession traffic via URLProtocol, with headers, pretty-printed JSON bodies, search and filters
- Works with your own URLSessions and keeps their settings, so cookies, caching and SSL pinning still behave normally (auth challenges are forwarded to your session's delegate)
- PostHog events through its beforeSend hook, and each event links to the batch request that uploaded it (Snitch unzips the gzip body and matches event IDs)
- AppsFlyer events with zero code changes: it finds the SDK at runtime and wraps its public logEvent methods, so there's no AppsFlyer dependency
- Copy as cURL, pause recording, light and dark mode, Liquid Glass on iOS 26 with a fallback to iOS 16
- Debug-only: every call is a no-op without DEBUG, and nothing leaves the device
The core has zero third-party dependencies. Setup is one line: Snitch.start()
GitHub: https://github.com/BachoOnn/snitch
I also shared the story behind it on LinkedIn, with a few slides showing it in action:
Linkedin post
It's still early, so I'd really appreciate feedback, bug reports, or ideas for which SDK to support next (Firebase? Mixpanel?). Happy to answer questions about how any of it works.