How to Manually Symbolicate iOS Crash to View Crash Logs
Asked Answered
B

6

27

Trying to debug app. The trouble is I cannot find this program.

symbolicatecrash.sh

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

Is it a separate download? I am using XCode 3.2.3

Thanks.

Bourke answered 30/9, 2010 at 16:50 Comment(0)
C
90

EDIT :: XCode 4.3

You will want to follow the same steps as outlined in the original answer (below) with a few exceptions.

First, you need to fix the Xcode path. Open a terminal and run:

/usr/bin/xcode-select -print-path

If it displays "/Developer" or anything but "/Applications/Xcode.app/Contents/Developer/" then it is wrong. To fix this run the command:

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer/

You can now run all the steps below, with the exception that the symbolicatecrash command is in a new spot (again). This is because Xcode now installs as an app. To find symbolicatecrash run this from the terminal:

find /Applications/Xcode.app -name symbolicatecrash -type f

This should return:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash

Before running symbolicatecrash you may wish to go to this directory like:

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/


Original Answer :: Xcode < 4.3

Path for symbolicatecrash

Search from a terminal using:

find /Developer -name symbolicatecrash -type f

For me this returned:

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

How to Manually Symbolicate a Crash Log

Run the symbolicatecrash command with the crash log as the first argument and your dSYM file as your second argument. Note that if you will be running symbolicatecrash from the current directory that you MUST put ./ in front like ./symbolicatecrash unless your PATH environment variable includes the directory that the command resides in.

I changed to the directory that had the symbolicatecrash command in it first (note: will be different for Xcode 4.3, see top):

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

Then I executed the following command:

./symbolicatecrash /somePath/MyCrashLogFile.crash /somePath/MyAppName.app.dSYM

How to Find the dSYM file:

You must have the archive that was used to create the build with the crash to get the dSYM file.

Here are the steps:

  1. Right click (or ctrl click) the archive from organizer and choose "Show in Finder".
  2. From the xcarchive file in finder, right click (or ctrl click) this file and choose "Show Package Contents". You will then see a "dSYMs" folder.
  3. Inside the "dSYMs" folder you will find "YourAppName.app.dSYM" file that you will need to symbolicate files.
Camey answered 27/12, 2011 at 19:0 Comment(4)
I get this error when I try to run symbolicatecrash: Error: "DEVELOPER_DIR" is not defined at ./symbolicatecrash line 53. EDIT: this worked: export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer"Valency
It should be worth noting that symbolication will not work unless you have the proper .app extracted from the same .ipa that caused the crash in the same folder as your .dSYM and .crash. I suggest crating a new folder on your Desktop and put the .dSYM and .crash file in it. Then extract the .app from your ApplicationName.ipa by changing the name to ApplicationName.zip, double click it to unzip the contents. Open the folder and find ApplicationName.app inside. Copy ApplicationName.app into your folder on the Desktop. Now run symbolication on your .crash & .dSYM in that folder.Torino
In Xcode 6 the path is Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrashCodee
You must run $export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ to resolve Error: "DEVELOPER_DIR" is not definedBayless
K
5

A plugin is available for Xcode under the Product menu. This plugin is available through Alcatraz package manager or can be directly downloaded from github.

This plugin internally incorporates a shell script that does the set up of running the following commands for manual crash symbolication.

  1. Set an alias to symbolicatecrash.pl perl script

alias symbolicatecrash='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash'

  1. To find symbolicatecrash, should it differ from the alias above:

find /Applications/Xcode.app -name symbolicatecrash -type f

  1. Set the DEVELOPER_DIR variable:

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

  1. With the dSYM the crash can be symbolicates as:

symbolicatecrash /path/to/MyApp_2012-10-01_Device.crash /path/to/MyApp.app.dSYM.

Karlynkarma answered 18/7, 2015 at 1:42 Comment(0)
W
4

One way to symbolicate a crash log is to run the following command on terminal:

xcrun atos -o MyApp.app/MyApp -arch armv7 -l 0xb7000 -f MyApp.crash

Replace the example hexadecimal number(0xb700) in the command above with the base load address. Base load address is the first memory address in the line immediately after

"Binary Images:"

To get the .app file:

Right click on the xcarchive file and select Show Package Contents The .app file is in the Products/Applications directory.

Weatherley answered 14/10, 2014 at 17:8 Comment(1)
Helped me. Thanks. Symbolicatecrash for some reasons symbolicated only part of methods from my app. xcrun atos shows me all. Here you can see explanation of some aspects of atos: #7676363Retrogradation
D
2

As Apple explains, Xcode will try to symbolicate automatically. It uses symbolicatecrash and spotlight to do that. However if the app wasn't built locally or it was deleted, then the necessary .app and .dsym files are not available.

So keep around the dsym file and the app of released versions. Build tools will often zip the .dsym file to a .dsym.zip and package the .app as an .ipa. You can unzip both and copy .app and .dsym to the same folder. Then Xcode will be able to find them using spotlight.

Display answered 30/9, 2010 at 16:51 Comment(0)
C
2

I just wrote a post on debugging crash log 5 min ago here: http://just2us.com/2010/10/reading-iphone-crashlog/

You might not need symbolicatecrash.sh anymore if drag and drop the logs to Xcode is good enough for your purpose. I am using 3.2.4, and I can't find the script too.

Cilo answered 30/9, 2010 at 17:9 Comment(2)
Yes, this script should no longer be necessary.Lysine
@BradLarson Turns out the script is still necessary. I imported an archive that was built on another computer and for whatever reason XCode simply wouldn't automatically symbolicate crash logs for builds made from that archive. :( However, using symbolicatecrash I was still able to symbolicate the crashes. However, I would definitely prefer XCode symbolicate it automatically, it just doesn't always is all.Camey
T
1

Here is a simple method I use:

  1. Open Xcode 6
  2. Plug in your dev device
  3. Within Xcode, go to Window > Devices > Select your device
  4. Press 'View Device Logs'
  5. Drag your report into the window to view it
Threemaster answered 24/2, 2015 at 13:18 Comment(1)
'View Deivce Logs' doesn't exist on Mac device, so how to view the OSX Apps' crash logs with symbolicate?Inhalant

© 2022 - 2024 — McMap. All rights reserved.