How to symbolicate crash log Xcode?

后端 未结 12 1060
别那么骄傲
别那么骄傲 2020-11-22 12:28

Xcode 5 organizer had a view which would list all the crash logs. and we could drag drop crash logs here. But since Xcode 6, I know they have moved devices out of organize a

相关标签:
12条回答
  • 2020-11-22 13:00

    You can refer this one too, I have written step by step procedure of Manual Crash Re-Symbolication.

    Crash Re-Symbolication

    STEP 1

    Move all the above files (MyApp.app, MyApp-dSYM.dSYM and MyApp-Crash-log.crash) into a Folder with a convenient name wherever you can go using Terminal easily.

    For me, Desktop is the most easily reachable place ;) So, I have moved these three files into a folder MyApp at Desktop.

    STEP 2

    Now its turn of Finder, Go to the path from following whichever is applicable for your XCODE version.

    Use this command to find the symbolicatecrash script file,
    find /Applications/Xcode.app -name symbolicatecrash

    Xcode 8, Xcode 9, Xcode 11 /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash

    Xcode 7.3 /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash

    XCode 7 /Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash

    Xcode 6 /Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources

    Lower then Xcode 6 Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKitBase.framework/Versions/A/Resources

    Or Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources

    STEP 3

    Add the found symbolicatecrash script file's directory to $PATH env variable like this: sudo vim /etc/paths.d/Xcode-symbolicatecrash and paste the script file's directory and save the file. When opening a new terminal, you can call symbolicatecrash at any folder as commands located in /usr/bin.

    Or

    Copy symbolicatecrash file from this location, and paste it to the Desktop/MyApp (Wait… Don’t blindly follow me, I am pasting sybolicatecrash file in folder MyApp, one that you created in step one at your favorite location, having three files.)

    STEP 4

    Open Terminal, and CD to the MyApp Folder.

    cd Desktop/MyApp — Press Enter
    export DEVELOPER_DIR=$(xcode-select --print-path)
    

     — Press Enter

    ./symbolicatecrash -v MyApp-Crash-log.crash MyApp.dSYM
    

     — Press Enter

    That’s it !! Symbolicated logs are on your terminal… now what are you waiting for? Now simply, Find out the Error and resolve it ;)

    Happy Coding !!!

    0 讨论(0)
  • 2020-11-22 13:04

    Ok I realised that you can do this:

    1. In Xcode > Window > Devices, select a connected iPhone/iPad/etc top left.
    2. View Device Logs
    3. All Logs

    You probably have a lot of logs there, and to make it easier to find your imported log later, you could just go ahead and delete all logs at this point... unless they mean money to you. Or unless you know the exact point of time the crash happened - it should be written in the file anyway... I'm lazy so I just delete all old logs (this actually took a while).

    1. Just drag and drop your file into that list. It worked for me.
    0 讨论(0)
  • 2020-11-22 13:04

    For me the .crash file was enough. Without .dSYM file and .app file.

    I ran these two commands on the mac where I build the archive and it worked:

    export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer" 
    
    /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash  /yourPath/crash1.crash > /yourPath/crash1_symbolicated.crash
    
    0 讨论(0)
  • 2020-11-22 13:04

    The easiest process to symbolicate crash logs:

    1. preserve the xcarchive file from the organizer during IPA building process for future use.
    2. When the crash occurs, collect the crash logs from affected device. The extension should be .crash. If the crash log is in .ips format, just rename it to .crash.
    3. Double click the xcarchive from the stored path to make it appear in organizer(if not present already).
    4. open in xcode window->devices and simulators -> view device logs -> all logs -> drag and drop the .crash file.

    Wait for 5secs. Bang! the application calls in stack trace will be symbolicated! You may still see a lot of symbols though! those are internal library and framework calls.

    This is the easiest one, tried and tested!

    0 讨论(0)
  • 2020-11-22 13:05

    There is an easier way using Xcode (without using command line tools and looking up addresses one at a time)

    1. Take any .xcarchive file. If you have one from before you can use that. If you don't have one, create one by running the Product > Archive from Xcode.

    2. Right click on the .xcarchive file and select 'Show Package Contents'

    3. Copy the dsym file (of the version of the app that crashed) to the dSYMs folder

    4. Copy the .app file (of the version of the app that crashed) to the Products > Applications folder

    5. Edit the Info.plist and edit the CFBundleShortVersionString and CFBundleVersion under the ApplicationProperties dictionary. This will help you identify the archive later

    6. Double click the .xcarchive to import it to Xcode. It should open Organizer.

    7. Go back to the crash log (in Devices window in Xcode)

    8. Drag your .crash file there (if not already present)

    9. The entire crash log should now be symbolicated. If not, then right click and select 'Re-symbolicate crash log'

    0 讨论(0)
  • 2020-11-22 13:06

    From Apple's docs:

    Symbolicating Crash Reports With Xcode Xcode will automatically attempt to symbolicate all crash reports that it encounters. All you need to do for symbolication is to add the crash report to the Xcode Organizer.

    • Connect an iOS device to your Mac
    • Choose "Devices" from the "Window" menu
    • Under the "DEVICES" section in the left column, choose a device
    • Click the "View Device Logs" button under the "Device Information" section on the right hand panel
    • Drag your crash report onto the left column of the presented panel
    • Xcode will automatically symbolicate the crash report and display the results To symbolicate a crash report, Xcode needs to be able to locate the following:

      1. The crashing application's binary and dSYM file.

      2. The binaries and dSYM files for all custom frameworks that the application links against. For frameworks that were built from source with the application, their dSYM files are copied into the archive alongside the application's dSYM file. For frameworks that were built by a third-party, you will need to ask the author for the dSYM file.

      3. Symbols for the OS that the that application was running on when it crashed. These symbols contain debug information for the frameworks included in a specific OS release (e.g, iOS 9.3.3). OS symbols are architecture specific - a release of iOS for 64-bit devices won't include armv7 symbols. Xcode will automatically copy OS symbols from each device that you connect to your Mac.

    If any of these are missing Xcode may not be able to symbolicate the crash report, or may only partially symbolicate the crash report.

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