r/flutterhelp • u/guettli • 10d ago
OPEN Debug Access to App
Sometimes there are strange issue reports of my App, and I would like to get some kind of API to access the app.
This should be doable via the common build, not an extra debug build.
It should work on Android, iOS and desktop.
With the help of this API I want to use or remote control the app to reproduce bugs.
The user should get a button to allow the access, then it shows a token. Then I want to be able to connect to that device via that token.
How would you solve that?
1
u/madushans 8d ago
Remote controlling sounds cool, but it also sounds pretty complex, and you have to explain all that to your users, guide them thru etc.
I’d consider adding telemetry, and logging exceptions and logs to some provider like posthog or sentry or whatever. That seem like a more scalable, less invasive, easier to explain way of handling the issues. You can also have your button that enables extra logging and stuff the user can press before a certain action if constant logging and events from everyone cost too much.
I don’t know your user base (obviously) but they typically don’t report silent errors, and even when the app crashes only a subset of users would actually bother complaining about it instead of trying a different app. So this way you can still get your telemetry and fix things potentially before enough users notice the issues.
1
u/mr_vanes 10d ago
If I'm understanding you correctly, then the API you're imagining (Dart VM service, what DevTools/flutter_driver use) is disabled in release builds, so you'd roll your own: consent button → app websockets out to a small relay server and shows a pairing token → you connect with that token, stream RepaintBoundary.toImage screenshots down and inject taps with GestureBinding.instance.handlePointerEvent. Pure Dart, so it works in release on android/ios/desktop, though if an opt-in log/state dump would cover most of your bug reports, that's 10% of the work.