Debugging standalone apps

What are my options to debug standalone app? I don’t mean just errors, but even logging or investigating state of the app?

For example I have a Google login (with Expo API), followed instructions to setup for standalone apps. It seems to be working to that point that native Google login is shown and when I confirm it, it looks like the app just restarted and shows the login again.

I’ve followed up instruction to setup Sentry. Again it’s working in development, but in production no errors are reported on crash :frowning: I tried adb logcat, but no error is popping there.

I am feeling bit frustrated by this. I am mostly web developer and even production apps can be debugged or at least see console for errors/warnings. Here it feels like black box I cannot touch.

Am I missing something obvious? Doesn’t seem that anybody else has issues like that.

Hi, sorry about this, the APK you get is a production APK so unfortunately you can’t hook it up to the debugger. Perhaps we need to give developers a way to get a development APK.

1 Like

This would be awesome - is there a feature request we can vote on?

I don’t think this exists yet - you could create one and share it here!

I am not sure if that’s a right solution to the problem. I mean the development APK will be somehow different than production one. What if there will be a problem in the latter one only?

I would like to open discussions here what are other options for this. A first thing that comes to my mind is some external logging service to at least see what state your application end up at, but that assumes that developer won’t be lazy to do that. Also, it will make whole bundle little bit bigger and probably with a performance impact. It would be necessary to have some sort of staging environment that would be separated from production.

Remote debugging is probably out of the question for production bundles.

You can upload errors to Sentry if you’re in a production environment, we have docs that cover using it as the “external logging service” you propose.

Hi @dikaiosune. I am having the same problem here. My app works fine in development but in production on a certain user journey it crashes. I have added Sentry and published via the Expo IDE but nothing is being reported to my Sentry account. My application just closes itself. I can confirm my Sentry is working as I was able to send through some test exceptions in the development environment.

3 Likes

Hey all - having a similar problem where everything works fine in development, but some items fail to display in the bundled app. Any suggestions?

Hi @nomadtm - if it’s bundled assets that are failing to display, you may want to check out our guide here and make sure you’re specifying assetBundlePatterns correctly. https://docs.expo.io/versions/v27.0.0/guides/offline-support#bundle-your-assets-inside-your-standalone-binary If your JS is just behaving differently, you can also try running your project with exp start --no-dev --minify to get a bundle in development similar to one in production, which can help with diagnosing errors.

Otherwise, if you want to open up a new thread with more specific information, we can try and help you some more! :slight_smile:

Thanks for the response. The fix ended up being a simple error on our part.
Immutable is minimized on the standalone app so item.constructor was function t() { ... } for all the Immutable objects and the item.constructor.name switch statement in ScheduleViewItem was skipping to the default: return null case. The fix was just using item.constructor._name instead of item.constructor.name for Immutable objects

Hi,

I’m having problems in locating errors on my application once it is converted into standalone app. It is working fine on expo development mode.

My splash screen and the home area are loading fine (*which maybe negates bundling error issue - because these sections are loading assets). However, it seems to turn into white screen and restarts when it is navigating into submenus. I could not provide much details because I have no idea where to look for error messages / debug logs / traces of errors.

I know this is an old topic, but is it possible that I’m missing a new way to debug a standalone application? Is there anyway to do this beside running expo similar to production build (“exp start -c --minify --no-dev”) ?

Thanks for anyone who is kind enough to answer this question.

3 Likes

I would like to have this feature, too.

Hey, I really need this feature too, my app is working in expo publish, is working with --minify and --no-dev flags, it just doesn’t work on standalone apk… just white screen, and sentry is not reporting anything. I have been stuck on this problem for a week now

+1 for this feature. There are several APIs that are virtually impossible to debug in the expo client. For example i cannot test push notifications nor background tracking as they don’t operate in the expo client the same way. I’m also observing different behavior between standalone and expo client run that is causing crashes only in the standalone build.

So i end up having to build and then look at logcat to attempt to see what is going on. This black box level testing is VERY hard to do.

1 Like