xcode 如何表示用户通过电子邮件发送给我的 Mac OS X 应用程序的崩溃报告?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6085734/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I symbolicate a crash report of a Mac OS X app that a user emailed to me?
提问by theMikeSwan
I am working on an app that I have sent to a few beta testers. Within just a few minutes of launching the app a user got a crash. When the window poped up saying the app had crashed he copied all of the text in the details section and emailed it to me. I have saved the text into a plain text file and given it the .crash extension which causes it to be opened by console like a regular crash report so I think I have the extension right (but maybe not).
The version I sent out was built by Xcode with the Archive option so Xcode knows where the app and .dSYM are.
I know that with iPhone apps you can drag a crash report to the organizer and Xcode will symbolicate it for you. I can not find anywhere that will take a Mac crash report.
I have looked at atos
but it talks about memory locations including the location the app was running at and I don't see that information listed in the report I have. Looking at the raw crash report it looks like a view controller was released early but I can't really tell if that was the cause or a symptom.
My real question is; is there a way to have Xcode symbolicate the report or a tool that I can just hand over the .dSYM file, app, and report and get back a symbolicated report?
I've looked all over Google but everything I find (other than the previously mentioned man pages for atos
) is about symbolicating iPhone reports, not Mac OS X ones.
我正在开发一个应用程序,该应用程序已发送给一些 Beta 测试人员。在启动应用程序的几分钟内,用户就崩溃了。当弹出窗口说应用程序崩溃时,他复制了详细信息部分中的所有文本并通过电子邮件发送给我。我已将文本保存到纯文本文件中,并为其指定了 .crash 扩展名,这会导致它像常规崩溃报告一样由控制台打开,因此我认为我拥有正确的扩展名(但可能没有)。我发送的版本是由 Xcode 使用存档选项构建的,因此 Xcode 知道应用程序和 .dSYM 在哪里。我知道使用 iPhone 应用程序,您可以将崩溃报告拖到管理器中,Xcode 会为您进行符号化。我找不到任何可以获取 Mac 崩溃报告的地方。我看过atos
但它讨论了内存位置,包括应用程序运行所在的位置,而我在我拥有的报告中没有看到该信息。查看原始崩溃报告,似乎视图控制器已提前发布,但我无法确定这是原因还是症状。我真正的问题是;有没有办法让 Xcode 对报告进行符号化,或者我可以使用一种工具来让我只交出 .dSYM 文件、应用程序和报告并取回一个符号化的报告?我已经在 Google 上找遍了所有我发现的东西(除了前面提到的手册页atos
)都是关于象征 iPhone 报告,而不是 Mac OS X 报告。
采纳答案by mahal tertin
Or as in answer https://stackoverflow.com/a/18354072/317461
或者如回答https://stackoverflow.com/a/18354072/317461
Put your release build and your .dSYM file in the same directory and open terminal
将您的发布版本和 .dSYM 文件放在同一目录中并打开终端
$cd directory
$lldb MyApp.app
(lldb) image lookup -v --address 0x00085f3c
回答by Lukas Neumann
We had the same problem with our app and I was symbolicating the crash reports manually line by line with atos
.
我们的应用程序遇到了同样的问题,我正在用atos
.
I now tweaked Apple's symbolicate script such that it works with Mac apps and crash reports from PLCrashReporter.
我现在调整了 Apple 的符号脚本,使其适用于 Mac 应用程序和来自 PLCrashReporter 的崩溃报告。
https://github.com/lksnmnn/Symbolicate-CrashReports
https://github.com/lksnmnn/Symbolicate-CrashReports
How to use it:
如何使用它:
Make sure you have all of the following files on your computer:
确保您的计算机上具有以下所有文件:
- The crash report: report.crash
- The dSYM file of your app: MyApp.dSYM
- The executable / app folder of your app: MyApp.app
- The improved symbolicate script: symbolicatecrash
- 崩溃报告:report.crash
- 您的应用程序的 dSYM 文件:MyApp.dSYM
- 您的应用程序的可执行文件 / app 文件夹:MyApp.app
- 改进的符号脚本:symbolicatecrash
Now go in the command line (Terminal) and do the following:
现在进入命令行(终端)并执行以下操作:
# set the developer directory
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
# Now run the script
/Path/To/symbolicatecrash /Path/To/report.crash > /Path/To/readable_report.crash
# Use -v for verbose logging.
The script will find your dSYM and your executable and symbolicates as much as it cans. You will now find your symbolicated report in the stated output file readable_report.crash
该脚本将找到您的 dSYM 和您的可执行文件,并尽可能多地进行符号化。您现在将在规定的输出文件readable_report.crash 中找到您的符号化报告
Build settings:
构建设置:
For proper reports and symbols, set your build settings to this:
要获得正确的报告和符号,请将构建设置设置为:
Strip Debug Symbols During Copy: Yes
Strip Style: All Symbols
Strip Linked Product: Yes
Edit: Improved the answer such that it aligns with the Stack Overflow answer policy.
编辑:改进了答案,使其与 Stack Overflow 答案政策保持一致。
回答by Parag Bafna
You can use GDB for Symbolication, Put your release build and your .dSYM file in the same directory open terminal
您可以使用 GDB 进行符号化,将您的发布版本和 .dSYM 文件放在同一目录中打开终端
$ cd directory
$ gdb MyApp.app
(gdb) info line *0x00085f3c