Friday, 30 May 2014

Symbolicate a crash log in Xcode










 Most embracing situation for an app developer is when someone told him that your app crashed. Then developer will try to reproduce the same crash at its end. If he found it or reproduce crash successfully then it goes well for him as its easy to fix it. But can you imagine the situation, when its not reproducible at developer end. Its very hard to find the crash, To save your self as a developer from this situation you have two ways to follow




1) Add third party SDK's that log  a report on their server when crash happened to user. Some of them are crittercism, crashlytics, testflight . You can go to their website and integrate their SDK in to your code. So whenever a crash occurred in your app you are notified with mail and a symbolicated crash log, i.e. log will tell the exact line of the file in which crash occurred.




2) Ask your user to send crash reports to you so that you can analyze them. For this you should have .dysm file of each build sent by you to testers or .app or .ipa or archive of the app uploaded to  App store.

        To get the crash report tell your test users to first sync their phone to iTunes. In the Finder, hold down the option key and open the Go menu and choose Library. Then navigate to ~/Library/Logs/CrashReporter/MobileDevice//.

For more info you can follow this link http://bjango.com/help/crashlog/

Locate the correct crash file whose name is same as of your app and send that file to you.
Now to use it, open your Xcode--> window--> organizer -->Libarary --> Device logs --> in the bottom their is button Import, click on it and import your crash file to Xcode it will automatically symbolicate crash file. If some how its not symbolicated then try pressing Re-Symbolicate button.

 Below is the image for the organiser with crash log


In above image you can check for the line that caused the app crash.Start from the bottom, as all the events occurred when app starts were written from bottom. So coming from bottom towards to, we can find out the exact line. To find out the line that caused app crash find out NSException raised and the line below it is the line of code that caused app crash.

Hope it helps you and thanks for reading the article. If you have any questions feel free to comment.

No comments:
Write comments