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
Xcode 11.2.1, December 2019
Apple gives you crash log in .txt format , which is unsymbolicated
**
With the device connected
**
- Download ".txt" file , change extension to ".crash"
- Open devices and simulators from window tab in Xcode
- select device and select device logs
- drag and drop .crash file to the device log window
We will be able to see symbolicated crash logs over there
Please see the link for more details on Symbolicating Crash logs
Writing this answer as much for the community as for myself.
If there ever are problems symbolicating a crash report, one can overcome them as follows:
Create a separate folder, copy Foo.app
and Foo.app.dSYM
from the corresponding .xcarchive
into the folder. Also copy the .crash
report into the folder.
Open the crash report in TextEdit or elsewhere, go to the Binary Images:
section, and copy the first address there (e.g. 0xd7000
).
cd
into the folder. Now you can run the following command:
xcrun atos -o Foo.app/Foo -arch arm64 -l 0xd7000 0x0033f9bb
This will symbolicate the symbol at address 0x0033f9bb
. Please make sure to pick the correct value for the -arch
option (can be obtaned from the first line in the Binary Images:
section, or figured out from the Hardware Model:
in the crash report and the app's supported archs).
You can also copy the necessary addresses (e.g. a thread call stack) from the crash report directly into a text file (in TextEdit, hold Option and select the necessary text block, or copy and cut), to get something like this:
0x000f12fb
0x002726b7
0x0026d415
0x001f933b
0x001f86d3
Now you can save this into a text file, e.g. addr.txt
, and run the following command:
xcrun atos -o Foo.app/Foo -arch arm64 -l 0xd7000 -f addr.txt
This will give a nice symbolication for all the addresses at once.
P.S.
Before doing the above, it's worth checking that everything is set up correctly (as atos
will happily report something for basically any supplied address).
To do the checking, open the crash report, and go to the end of the call stack for Thread 0
. The first line from the end to list your app (usually the second one), e.g.:
34 Foo 0x0033f9bb 0xd7000 + 2525627
should be the main()
call. Symbolicating the address (0x0033f9bb
in this case) as described above should confirm that this is indeed main()
and not some random method or function.
If the address is not that of main()
, check your load address (-l
option) and arch (-arch
option).
P.P.S.
If the above doesn't work due to bitcode, download the dSYM for your build from iTunes Connect, extract the executable binary from the dSYM (Finder > Show Package Contents), copy it into the directory, and use it (i.e. Foo
) as the argument to atos
, instead of the Foo.app/Foo
.
Make sure that your Xcode application name doesn't contain any spaces. This was the reason it didn't work for me. So /Applications/Xcode.app
works, while /Applications/Xcode 6.1.1.app
doesn't work.
If you have the .dSYM and the .crash file in the same sub-folder, these are the steps you can take:
$ atos -arch arm64 -o TheElements.app.dSYM/Contents/Resources/DWARF/TheElements -l 0x1000e4000 0x00000001000effdc
-[AtomicElementViewController myTransitionDidStop:finished:context:]
Authoritative source: https://developer.apple.com/library/content/technotes/tn2151/_index.html#//apple_ref/doc/uid/DTS40008184-CH1-SYMBOLICATE_WITH_ATOS
Follow these steps in Xcode 10 to symbolicate a crash log from an app build on the same machine:
Apple gives you crash log in .txt format , which is unsymbolicated
**
With the device connected
**
- Download ".txt" file , change extension to ".crash"
- Open devices and simulators from window tab in Xcode
- select device and select device logs
- drag and drop .crash file to the device log window
We will be able to see symbolicated crash logs over there
Please see the link for more details on Symbolicating Crash logs