Symbolicating iPhone App Crash Reports

后端 未结 25 2276
迷失自我
迷失自我 2020-11-21 05:38

I\'m looking to try and symbolicate my iPhone app\'s crash reports.

I retrieved the crash reports from iTunes Connect. I have the application binary that I submitted

相关标签:
25条回答
  • 2020-11-21 05:52

    Steps to symbolicate a crash report automatically using XCode:

    UPDATED FOR XCODE 9

    1. Connect any iOS device to your Mac (yes a physical one, yes I know this is stupid)

    2. Choose "Devices" from the "Window" menu

    3. Click your device on the left and VIEW DEVICE LOGS on the right

    4. Wait. It might take a minute to show up. Maybe doing Command-A then Delete will speed this up.

    5. Critical undocumented step: rename the crash report that you got from iTunesConnect from .txt extension to .crash extension

    6. Drag the crash report into that area on the left

    And then Xcode will symbolicate the crash report and display the results.

    Source: https://developer.apple.com/library/ios/technotes/tn2151/_index.html

    0 讨论(0)
  • 2020-11-21 05:52

    Here's another issue I have with symbolicatecrash – it won't work with Apps that have spaces in their bundle (i.e. 'Test App.app'). Note I don't think you can have spaces in their name when submitting so you should remove these anyway, but if you already have crashes that need analysing, patch symbolicatecrash (4.3 GM) as such:

    240c240
    <         my $cmd = "mdfind \"kMDItemContentType == com.apple.application-bundle && kMDItemFSName == $exec_name.app\"";
    ---
    >         my $cmd = "mdfind \"kMDItemContentType == com.apple.application-bundle && kMDItemFSName == '$exec_name.app'\"";
    251c251
    <             my $cmd = "find \"$archive_path/Products\" -name $exec_name.app";
    ---
    >             my $cmd = "find \"$archive_path/Products\" -name \"$exec_name.app\"";
    
    0 讨论(0)
  • 2020-11-21 05:53

    In my case, I was dragging crash reports directly from Mail to the Organizer. For some reason, that prevented the crash reports from getting symbolicated (I'd love to know why).

    Copying the crash reports to the Desktop first, and then dragging them from there to the Organizer got them symbolicated properly.

    Very specific case, I know. But thought I'd share just in case.

    0 讨论(0)
  • 2020-11-21 05:54

    I use Airbrake in my apps, which does a fairly good job of remote error logging.

    Here's how I symbolicate them with atos if the backtrace needs it:

    1. In Xcode (4.2) go to the organizer, right click on the archive from which the .ipa file was generated.

    2. In Terminal, cd into the xcarchive for instance MyCoolApp 10-27-11 1.30 PM.xcarchive

    3. Enter the following atos -arch armv7 -o 'MyCoolApp.app'/'MyCoolApp' (don't forget the single quotes)

    4. I don't include my symbol in that call. What you get is a block cursor on an empty line.

    5. Then I copy/paste my symbol code at that block cursor and press enter. You'll see something like:

      -[MyCoolVC dealloc] (in MyCoolApp) (MyCoolVC.m:34)

    6. You're back to a block cursor and you can paste in other symbols.

    Being able to go through your backtrace one item without re-entering the first bit is a nice time saver.

    Enjoy!

    0 讨论(0)
  • 2020-11-21 05:54

    I got a bit grumpy about the fact nothing here seems to "just work" so I did some investigating and the result is:

    Set up: QuincyKit back end that receives reports. No symbolication set up as I couldn't even begin to figure out what they were suggesting I do to make it work.

    The fix: download crash reports from the server online. They're called 'crash' and by default go into the ~/Downloads/ folder. With that in mind, this script will "do the right thing" and the crash reports will go into Xcode (Organizer, device logs) and symbolication will be done.

    The script:

    #!/bin/bash
    # Copy crash reports so that they appear in device logs in Organizer in Xcode
    
    if [ ! -e ~/Downloads/crash ]; then 
       echo "Download a crash report and save it as $HOME/Downloads/crash before running this script."
       exit 1
    fi
    
    cd ~/Library/Logs/CrashReporter/MobileDevice/
    mkdir -p actx # add crash report to xcode abbreviated
    cd actx
    
    datestr=`date "+%Y-%m-%d-%H%M%S"`
    
    mv ~/Downloads/crash "actx-app_"$datestr"_actx.crash"
    

    Things can be automated to where you can drag and drop in Xcode Organizer by doing two things if you do use QuincyKit/PLCR.

    Firstly, you have to edit the remote script admin/actionapi.php ~line 202. It doesn't seem to get the timestamp right, so the file ends up with the name 'crash' which Xcode doesn't recognize (it wants something dot crash):

    header('Content-Disposition: attachment; filename="crash'.$timestamp.'.crash"');
    

    Secondly, in the iOS side in QuincyKit BWCrashReportTextFormatter.m ~line 176, change @"[TODO]" to @"TODO" to get around the bad characters.

    0 讨论(0)
  • 2020-11-21 05:55

    The combination that worked for me was:

    1. Copy the dSYM file into the directory where the crash report was
    2. Unzip the ipa file containing the app ('unzip MyApp.ipa')
    3. Copy the application binary from the resulting exploded payload into the same folder as the crash report and symbol file (Something like "MyApp.app/MyApp")
    4. Import or Re-symbolicate the crash report from within Xcode's organizer

    Using atos I wasn't able to resolve the correct symbol information with the addresses and offsets that were in the crash report. When I did this, I see something more meaningful, and it seems to be a legitimate stack trace.

    0 讨论(0)
提交回复
热议问题