How to symbolicate crash/error logs from a Xamarin Forms iOS project?
Asked Answered
C

1

13

I need to symbolicate some crash logs and for that I read that I need the .app and the .dSYM files together with the .crash files.

I can't find the .app file anywhere. I have the .app.dSYM file and the .crash ones but I can't find the .app one.

I can also see my error logs on the Xcode Organizer. But the lines from my Application are not symbolicated. And if I click on the arrow to open with a project, I have no idea which file to open.

Thanks

Cowling answered 25/7, 2016 at 23:56 Comment(0)
F
21

When you build your iOS project, you should have the .app file in the bin/iPhone/Release directory. Or, if you have the .ipa file, you can extract the .app from that with. You can rename the file to have .zip and extract. The .app will be in the Payload folder. On Windows, it can be a little confusing because the icon might look like a Folder or Directory. Check the file extension. On Mac, it should recognize a .app and it might not show the extension at all. Instead, it looks like this:

enter image description here

Important: You need to use the same .app file that generated the crash report. This means you would have to use the .app from the package you installed on the device that generated the crash report. Hopefully, you archived that or saved it somewhere. Simply rebuilding the project to get a new .app will not match up with the .crash file during symbolication and will not work. If you don't have access to that, you will need to publish again and this time keep the .app around for the next time you get a .crash to analyze.

To manually symbolicate, I have a blog post about doing this here. To summarize, here are the steps:

Create an Alias

Open Terminal and run one of these commands for your version of Xcode:

Xcode 7.X
alias symbolicate="/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash -v"  

This just makes using the symbolicatecrash tool easier by aliasing it to a symbolicate command so we don't have to navigate to that directory to run the command.

Update the Developer Directory

Run this command:

export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"

Symbolicate

Open Terminal again and cd to the directory where you placed your files in the step above. Run the symbolicate command we aliased before with your .crash and .app files as the parameters like this:

symbolicate -o "symbolicatedCrash.txt" "MyAppName 2-12-14, 9-44 PM.crash" "MyAppName.app"

This will symbolicate the crash file and spit out the result in a new file named "symbolicatedCrash.txt". Make sure that correct the file names from my example to match yours.

Formalism answered 26/7, 2016 at 15:47 Comment(4)
It worked like a charm. But my .app file is definitely not in that folder. But I managed to get it from the ipa.Cowling
Now I need help understanding this log. It doesn't look like a problem in my code. The released App works for a while, but then starts crashing before finish launching. And I couldn't find anything that leads to my code. It crashes in InitializeComponent for the first app view. But I can't just post it here and ask for help so... is there a way for you to help me with that? I'm getting really bad reviews for days :/Cowling
Sure! File a bug at bugzilla.xamarin.com/enter_bug.cgi?product=Forms and attach any files you can share privately. I'll be able to take a look at them after. Comment and let me know the link to the bug. You can make the entire bug private if you want too.Formalism
Where do I find the dSym files nowadays? In the xcarchive file?Botryoidal

© 2022 - 2024 — McMap. All rights reserved.