Home > N-FAQ > How to symbolicate iPhone Crash Reports;

How to symbolicate iPhone Crash Reports;

Hello Everyone;
Hows your developments going? Im sure you enjoy it as much as i do; Its really a fun;

Today’s menu is related to iPhone Applications; We often notice that iPhone/iPod/iPad applications hangup or exit abnormally; It means the running application has been crashed due to some unknown reason; It really annoy the users and no one want to even use them; This thing also annoy the developers and they want to know the reason why it get crash at particular point;

In such scenarios, the device generates a log file that called crash report; It holds all the information about the reason that leads the application to crash; These reports are a vital developer’s tool to help squash bugs and improve their software; The iPhone OS stores crash reports on the iPhone or iPod touch whenever an app crashes, and those get backed up whenever the device is synced with iTunes;

Steps to fetch crash reports (User End)
– Sync your iPhone to iTunes.
– Find the crash logs on your computer.  Here is where they’re located;

  • Mac OS X ~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME>
  • Windows XPC:\Documents and Settings\<USERNAME>\Application Data\Apple computer\Logs\CrashReporter/<DEVICE_NAME>
  • Windows Vista\Windows 7:C:\Users\<USERNAME>\AppData\Roaming\Apple computer\Logs\CrashReporter/MobileDevice/<DEVICE_NAME>

The log file names start with application name and have the extension “crash”; The logs themselves are just text files, so you can open them in your text editor and cut&paste, or (preferably) attach them to an email to sent to developers;

A typical crash report looks like this (if you open it in text editor)

Here <application name> is the name of your application that crashed;

Steps to symbolicate crash Report; (Developer End)

Symbolication is a process of decoding the crash report to find out the exact class name and method name that creates problem;

You can notice in above image that there were different thread that were running parallel and the 2nd line tells us which thread crashed; After decoding the crash report , you will go through that thread entries to find out your classes/method;

There is a script available in your mac machine for symbolication process; You can find that script at

/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/Resources/symbolicatecrash /usr/local/bin/

If you unable to find it, I have upload it at following url; unzip it and put at your preferable location;

http://dl.dropbox.com/u/18976202/symbolicatecrash.zip

Note: IT IS VERY IMPORTANT THAT YOU SAVE YOUR BINARY FILE (APP FILE) ALONG WITH dSYM FILE WHEN YOU SHIP YOUR APPLICATION; WITHOUT HAVING THESE FILES YOU ARE NOT ABLE TO DECODE THE CRASH REPORTS;

Its time to start symbolication;

- Copy your crash report, .app file and .dSYM file along with downloaded scrip (Put everything in one directory)
– Open your terminal and move to the directory where you copy download script;
– execute following commad

./symbolicatecrash -A -v <crashReportName> <dSYM file name>

for example if your application name is myGame, then your binary file name would be myGame.app and your dSYM file would be myGame.app.dSYM.

The format of crash report name is as follow
applicationName_yyyy-mm-dd-hhmmss_deviceName.crash

Where yyyy_mm_dd is date formate .i.e. 2011-05-10 and hhmmss is time formate i.e. 085655.
This timestamps describes when a particular application crashed at user’s device;
deviceName is a name user chose for his/her device;

So you will execute this command to symbolicate the crash report;

./symbolicatecrash -A -v myGame_2011-04-26-085655_Ans-iPhone.crash myGame.app.dSYM
I’m sure you have now clear idea about different parts of this command;

The outcome of crash report will replace binary address of your methods and classes names with actual methods and classes names where the application crashed; It will also tell you the exact line number where you got problem;

By looking the highlighted area in red, isn’t much easy to know where the problem is? Yes it is;

Feel free to comment and suggestions;

Happy Development;

– This post belongs to N-FAQ category where i post anything i learn new during my work;
    N-FAQ = Not-FAQ;
You can find my other tutorials in My Tutorial section or in its sub menu; 

free counters

About these ads
  1. Aroosh
    May 10, 2011 at 07:29

    Really nice work Ans. Everytime you bring something informative topic. Again good job sir.

  2. Amjad Razi
    May 10, 2011 at 14:11

    grt work Ans. Your writing style is really simple and descriptive. You directly target the reader’s mind. keep blooging. good work.

  3. Cedric
    May 10, 2011 at 18:31

    search on google and found your post and it solve my prob in first attempt. before i tried using xcode but fail e time. you saved my much time.
    thx for dis.

  4. P. Smith
    May 10, 2011 at 21:11

    is that not possible by using xcode. i think you are driving us to some difficult process.

    • Ans
      May 11, 2011 at 02:08

      Yes you can do this directly from Window->Organizer and by drag-drop crash reports at Cash Report section at left side menu; Infact this the real way to do this; xcode internally calls this scrip and shows the result in main panel screen;

      Due to some unknown reason (i’m still digging) i was unable to symbolicate the crash reports my client sent to me, using this method; I tried it three different machins having my app file, dSYM file and crash reports together but no gain; The above mentioned method is proven is has been tested on multiple machines with different/same input data;

  5. Amna Zaree
    May 11, 2011 at 01:44

    wao Ans you rock again. you clearly told the whole story. worth to bookmark and share. how you find time to write all such things.

  6. tjseko
    May 29, 2011 at 16:30

    hi Ans, can i decrypt iphone mobile analyzer binary log files with this method ?
    Ex.
    filename:”IPHONE 0x00000000.mal.bin”
    MobileAnalyzer Enable & Disable Codes on Iphone:
    *5005*MA#[call]      - enable MobileAnalyzer (“MobileAnalyzer: enabled=true; fullTrace=false; lowLevelTrace=none”)
     #5005*MA#[call]  - disable MobileAnalyzer (“MobileAnalyzer: enabled=false; fullTrace=false; lowLevelTrace=none”)

  7. July 1, 2011 at 16:36

    Good work but
    for me don’t work this method. I have the error:
    “Can’t understand the output from otool (…) at ./symbolicatecrash line 323.”
    (I have the files .app, .app.dSYM, .crash and symbolicatecrash in the same folder)

    Any idea?
    Many thanks
    Alberto

    • Ans
      September 7, 2011 at 00:12

      @alberto: Do one thing;

      Delete the the application from your simulator, plus build directory from your code base;
      Then run symbolicate crash again, should work as expected;

      Infact symbolicatecrash script tries to find .dSYM file and build file using spotlight; In some cases it finds the version of simulator app and start symbolication; Try my hint and let me know if it works;

  8. July 4, 2011 at 14:19

    Thanks for the info.

    Recently i came to know that the symbolicated crash file is already available under the folder “DeviceName.symbolicated” which is under “MobileDevice” folder. When i open the .crash file, i exactly get the direct output which you ‘ve got at the end.

    But do you know any other way to decode the remaining address values ? line numbers 8-10 and 15-23 in your case. Please refer to the last screen shot posted by you.

    • Ans
      September 7, 2011 at 00:15

      I couldn’t find this directory under MobileDevices; I have “Provisioning Profiles” and “Archived Applications” there;

      I’m using xcode 4.0 (Build 4A304a) and Max OS 10.6.8;

  9. October 15, 2011 at 23:45

    Thank you for this post; I was wondering if was possible to get a real stack trace from the crash logs. Definitely helpful.

  10. Ricardo
    October 18, 2011 at 02:31

    The link does not work. Can you fix it?
    Thanks a lot.

  11. Bruce Cichowlas
    October 31, 2011 at 05:02

    I put everything in one folder, but it doesn’t seem to be able to find the .app file there.

    Or maybe it does and is missing something else. It says:

    ## Warning: Can’t find any unstripped binary that matches version of /var/mobile/Applications/1659F247-FC72-4718-9F45-D1054CD1FDE5/RK1-3-41.app/RK1-3-41

    What does it mean by “unstripped binary”?

    Here’s my command line: ./symbolicatecrash -A -v RK1-3-41_2011-10-30-153308_Bruces-Library-iPad.crash RK-1-3-41.app.dSYM

    I have RK1-3-41.app and also RK1-3-41.app.dSYM in the directory as well as the crash report (which I removed from the named iPad.

    Thanks,
    Bruce

    • Ans
      February 24, 2012 at 20:26

      Seems that your binary and .dSYM file doesn’t match with each other;
      Sorry for being so late for this reply, I missed it; Pardon me;

      So did get get the solution?

      • February 25, 2012 at 00:09

        Hi, Ans! I’m using Hockey and their Hockey App now for ad hoc deployment. Very, very convenient, not too expensive, works fine, impossible to make a mismatch and great support, too. Using Hockey has simplified all this. Thanks for your thoughtful reply.

  12. PwnApple
    April 23, 2012 at 18:55

    Bare with me as I was hit in a Hummer vs. Honda accident and have lost some memory. Internets the best thing it’s seems to jog it. I’m or I was an MIS major and have had computers in my blood since 5. I went to Defcon in 1999 by myself and hackers, though hilarious gave me goosebumps. Ive been trying to read this but what I’m not seeing is any jailbroken users thoughts. Saurik, Cydias founder has had a /Syslog dump as well as a pretty remarkable app called, CrashReporter for 2 to 3 years maybe even longer. It allows you to read the crash report or symbolicate it all in the same app. The thing I thought was pretty cool is that its doing it’s jobs even without u looking. I checked the other day and I had I’d guess 135 instances and it’s lists each one by AppName.ipa or .deb or for the rebel jailbreakers, it throws in MobileSubstrate. Now I never had time to truly delve into the inner symphony of IOS before my brain got rocked by Mr. Mid-Life crisis. I really really wanted to though. I will forever be an iPhone junkie for too many reasons to list. The most boring reason of all is it was what got me into UNIX. I’m now seeing though why Jobs Big Brother culture is so terrible for thr majority of us. Anyhow I ramble to much but I don’t give a dam# I will get that degree and stay with computers I just might not be the fastest. Now my main question guys is that CrashReporter is great but it doesn’t take you any further than your apps it sounds excepts it does it in .001 seconds and it’s constantly hoarding these crashes or errors. You go into it and like for me I saw about 50 names of may apps most had one crash or whatever and it gives u the date but one of mine “Sandboxd” had 95!!! So I ask myself why would Apple being Sandboxing anything or are they? Is it just a name? Is this part of mobile substrate? Makes sense right, its basically what mobile substrate does to bypass apple. Well I’d love to show you guys my syslogs/reports/symbolications. I’d love so see what the heck is going on that 95 crashes in a few days started to occurr. BTW I first noticed it when my mobilemail i.e. Email opens but nothing loads it just sits their white screened. Now I’d get frustrated and force it to close. Eventually though I checked thr CrashReporter like I said but not before I used one of the other benefits to jailbreaking, putting it in to Safe Mode. What do you know!!! It works!!! As most problems do, but I need a way to test it before and after or maybe someone out there could teach me how to read these crash reports because thr key to my dilemma is that it’s not mobilemail that’s causing thr problem its “Sandboxd” which I’m pretty sure means mobile substrate which in return means who the heck knows well I don’t. So please any help would be lovely. Thanks for hanging in their.

  13. amit garg
    September 28, 2012 at 11:42

    Hiiiii ans….
    I don’t have iPhoneRemoteDevice.xcodeplugin for symbolicate crashlog. The link is provided by you is not working. Can u send me this plugin.
    Thanks

    • Ans
      September 28, 2012 at 12:07

      Thanks for writing to me; Yes the link was broken; I have update the post with working link; You can now download it from http://dl.dropbox.com/u/18976202/symbolicatecrash.zip; Let me know If you find any problem;

      • amit garg
        October 4, 2012 at 17:32

        Hiiiiii ans…….
        Thanks for that link. I got that symbolicatecrash file, I put all the required files in 1 folder and execute the command for symbolicating but in result i got all the text of crash file on terminal. Please help me to get proper crash details with file name and line number….
        Thanks

  14. Prateek
    December 27, 2012 at 13:10

    jamesServer:crashlogs prateekverma$ ./symbolicatecrash -A -v CandidMarket_2012-12-27-104326_Cartier-iPad.crash CandidMarket.app.dSYM
    -bash: ./symbolicatecrash: Permission denied

    As above i kept every thing at one place and run the comment but i am getting Permission denied

    • Ans
      December 27, 2012 at 13:51

      tty with sudu command … And then tell me;

  15. Reno
    February 4, 2013 at 00:21

    Hi, I wonder if I can use the script in Linux. In the perl script it uses the command “atos” to symbolicate the numeric address to function name and line. Thanks.

  16. waleed
    February 5, 2013 at 18:23

    what mean:
    -bash: ./symbolicatecrash: Permission denied

    ?

    • Ans
      February 5, 2013 at 18:39

      yes its common .. try sudu command;

  17. May 2, 2013 at 12:14

    I get:
    -bash: ./symbolicatecrash: Permission denied
    ?
    what is sudu command?

  18. May 2, 2013 at 12:16

    it doesn’t work if I write sudu ./symbolicatecrash …. rest of the code

  19. May 2, 2013 at 14:18

    now it says … sudo: ./symbolicatecrash: command not found. Thanks for reply. Help me out whenever you are free.

    • May 2, 2013 at 18:25

      I thought I should mention and recommend Hockey ( http://hockeyapp.net ). It’s an inexpensive service with a free trial that will take care of all of your symbolication needs and do so much more. Since I’ve been using it, I haven’t had to worry about this sort of stuff at all. I use it for all ad hoc distribution needs as well for myself and my clients. I have no affiliation with them, just a fan, but you can try it out for free and at least get a few crashes symbolicated.

  20. May 3, 2013 at 14:18

    any updates? Plz help.

    • May 3, 2013 at 16:18

      Don’t know whether this will help, but I found this alias I must have made at some time when I did a “spotlight” on symbolicate crash. Perhaps it will help you find the file and let you give an appropriate full path.

      alias symbolicate=”/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash -v”

  21. June 22, 2013 at 03:43

    It’s awesome in support of me to have a web site, which is useful for my knowledge. thanks admin

  22. pratima
    January 10, 2014 at 06:11

    can we symbolicate crash reports as mentioned above in windows machine instead of mac?

  23. jagruti
    March 5, 2014 at 15:41

    rror: “DEVELOPER_DIR” is not defined at ./symbolicatecrash line 60. it is giving me this reply…..i have confusion in which i need to see line 60?

  1. May 23, 2011 at 23:04

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 37 other followers

%d bloggers like this: