Expo Crash on Standalone App only — How to Debug

Taku
2 min readJan 11, 2020

--

I spent too much time trying to find out how to debug the issue and by documenting this here, I hope this helps others who are struggling.

Background

I am using managed Expo version 35.0.0 with Typescript. In my dev environment, I run expo start and the app loads fine. However, when I make a build using expo build:ios --release-channel prod and run this on my device, it crashes. I was looking for ways to debug this but I could not…this is what I found after some researching.

I loaded the app in my expo client using expo start but when I built a standalone app, it would crash in both iOS and Android device and simulators. Note that I am using Mac with XCode 10.0.

Debug Steps

  1. I could not find how to debug this on the device but I found a way to debug this on a simulator using the same environment. So, I ran expo build:ios --release-channel prod -t simulator which should output .tar.gzfile instead of .ipa. If you forget the -t simulator , then your build will crash on your simulator.
  2. As usual, download the build from Expo to your local machine.

3. Run tar xvzf <your-app>.tar.gz to untar the zip

4. Runxcrun simctl install booted <your-app.app> to install this onto your iOS simulator. If this app already exists, remove the app before running this command. This command may fail the first time but running it the second time succeeds…

5. Runxcrun simctl launch booted <app identifier> to launch this app or launch via the UI on the simulator. This command may fail once but running it the second time succeeds.

6. The app should crash like it did with your device

7. The suggested way is to go into your Simulator’s Debug -> Open System Log but this only showed me assertion failed: 17G10021 16B91: libxpc.dylib + 79599 which is not very useful

8. What took me the longest to find is the JS crash logs. You want to look into ~/Library/Logs/DiagnosticReports/ and you should find some logs regarding your crashes from one of the files. You could run less *2020-05-13* and search through the logs.

9. Then I saw

Unhandled JS Exception: undefined is not an object (evaluating ‘n.default.manifest.debuggerHost.split’)’

which is how I specify the host when running on device using dev mode. manifest.debuggerHost is not defined when — release-channel is staging or prod.

I have still not found a way to debug this directly on the device. Any suggestion is helpful. Also, I have not done this in Android Emulators, but I will update once I go it in Android.

Happy Coding!

--

--