如何表示Apple 发布的Mac OSX 崩溃报告?

发布于 2024-11-04 09:40:44 字数 239 浏览 3 评论 0原文

对于 iOS 崩溃报告,将崩溃报告拖放到管理器中就足够了。

符号化 iPhone 应用程序崩溃报告

但此方法不适用于 Mac OSX 崩溃报告。

如何用符号表示我的 Mac OSX 崩溃报告?

谢谢 !!

For iOS crash reports, it is sufficient to drag and drop the crash report to the Organizer.

Symbolicating iPhone App Crash Reports

But this method doesn't work for Mac OSX crash reports.

How can I symbolicate my Mac OSX crash report ?

Thanks !!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

合久必婚 2024-11-11 09:40:53

您可以使用 atos 命令获取应用程序崩溃的行号。

这是一个快速指南:

  1. 为您的工作文件创建一个目录
  2. 打开 Xcode,选择“窗口”->“管理器”,转到“存档”选项卡并找到发生崩溃的应用程序版本。
  3. 右键单击应用程序存档并选择“在 Finder 中显示”
  4. 右键单击​​ .xarchive,选择“显示内容”并找到 AppName.dSYM 目录和应用程序并将它们复制到您的工作文件夹
  5. 将堆栈跟踪复制到您的工作文件夹
  6. 打开终端并更改为您的工作文件夹。 ls 应显示 YourApp.app YourApp.app.dSYM stacktrace.txt
  7. 在 TextEdit 中打开堆栈跟踪。您需要从标头中找到代码类型(系统架构 - 例如 X86-64)和崩溃的地址。搜索线程以找到崩溃的线程(它会显示类似“线程 2 崩溃”之类的内容),然后找到您的对象。您需要该行的两个地址(十六进制数字)才能获取代码行。
  8. 获得在终端中运行以下命令所需的所有信息后:

    atos -o YourApp.app/Contents/MacOS/YourApp -arch x86_64 -l [load-address] [address]

例如,这是堆栈跟踪的摘录:

Process:         MyApp [228]
Path:            /Applications/MyApp.app/Contents/MacOS/MyApp
Identifier:      uk.co.company.app
Version:         1.0 (1)
App Item ID:     774943227
App External ID: 218062633
Code Type:       X86-64 (Native)
Parent Process:  launchd [154]
Responsible:     MyApp [228]
User ID:         501

Date/Time:       2013-12-17 10:20:45.816 +0100
OS Version:      Mac OS X 10.9 (13A603)
Report Version:  11
Anonymous UUID:  7AA662B1-7696-A2C5-AF56-9D4BA2CE9515


Crashed Thread:  2

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

<snip>

Thread 2 Crashed:
0   libsystem_kernel.dylib          0x00007fff8b95a866 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff8bf4f35c pthread_kill + 92
2   libsystem_c.dylib               0x00007fff87571bba abort + 125
3   libsystem_malloc.dylib          0x00007fff897ae093 free + 411
4   uk.co.company.app           0x0000000103580606 0x10356e000 + 75270
5   uk.co.company.app               0x00000001035803da 0x10356e000 + 74714
6   com.apple.Foundation            0x00007fff8d00970b __NSThread__main__ + 1318
7   libsystem_pthread.dylib         0x00007fff8bf4e899 _pthread_body + 138
8   libsystem_pthread.dylib         0x00007fff8bf4e72a _pthread_start + 137
9   libsystem_pthread.dylib         0x00007fff8bf52fc9 thread_start + 13

我可以看到“代码类型”是x86_64,线程 2 崩溃了,并且在第 4 行我的代码正在运行,因此我们获得了所需的地址。使用此信息,我运行以下命令:

$ atos -o MyApp.app/Contents/MacOS/MyApp -arch x86_64 -l 0x10356e000 0x0000000103580606

返回:

got symbolicator for MyApp.app/Contents/MacOS/MyApp, base address 100000000
obj_free (in MyApp) (somefile.c:135)

告诉我我的应用程序在 somefile.c 的第 135 行崩溃

You can use the atos command to get the line number where the app crashed.

Heres a quick guide:

  1. Create a directory for your working files
  2. Open Xcode, select Window->Organizer, goto the Archive tab and find the version of your app that experienced the crash.
  3. Right click on the app archive and select "Show in Finder"
  4. Right click on the .xarchive, select "Show Contents" and find the AppName.dSYM directory and the app and copy them to your working folder
  5. Copy the stack trace to your working folder
  6. Open terminal and change to your working folder. An ls should show YourApp.app YourApp.app.dSYM stacktrace.txt
  7. Open your stack trace in TextEdit. Your going to need to find the Code Type from the header (system architecture - eg. X86-64) and the addresses of the crash. Search through the threads to find the one that crashed (it will say something like "Thread 2 Crashed") then find your objects. You need the two addresses (hex numbers) from that line to get the code line.
  8. Once you've got all the information you need to run the following in the terminal:

    atos -o YourApp.app/Contents/MacOS/YourApp -arch x86_64 -l [load-address] [address]

For example, heres an extract from a stacktrace:

Process:         MyApp [228]
Path:            /Applications/MyApp.app/Contents/MacOS/MyApp
Identifier:      uk.co.company.app
Version:         1.0 (1)
App Item ID:     774943227
App External ID: 218062633
Code Type:       X86-64 (Native)
Parent Process:  launchd [154]
Responsible:     MyApp [228]
User ID:         501

Date/Time:       2013-12-17 10:20:45.816 +0100
OS Version:      Mac OS X 10.9 (13A603)
Report Version:  11
Anonymous UUID:  7AA662B1-7696-A2C5-AF56-9D4BA2CE9515


Crashed Thread:  2

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

<snip>

Thread 2 Crashed:
0   libsystem_kernel.dylib          0x00007fff8b95a866 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff8bf4f35c pthread_kill + 92
2   libsystem_c.dylib               0x00007fff87571bba abort + 125
3   libsystem_malloc.dylib          0x00007fff897ae093 free + 411
4   uk.co.company.app           0x0000000103580606 0x10356e000 + 75270
5   uk.co.company.app               0x00000001035803da 0x10356e000 + 74714
6   com.apple.Foundation            0x00007fff8d00970b __NSThread__main__ + 1318
7   libsystem_pthread.dylib         0x00007fff8bf4e899 _pthread_body + 138
8   libsystem_pthread.dylib         0x00007fff8bf4e72a _pthread_start + 137
9   libsystem_pthread.dylib         0x00007fff8bf52fc9 thread_start + 13

I can see that the "Code Type" is x86_64, that Thread 2 crashed, and that on line 4 my code was running so we have the addresses we need. Using this information I run the following:

$ atos -o MyApp.app/Contents/MacOS/MyApp -arch x86_64 -l 0x10356e000 0x0000000103580606

This returns:

got symbolicator for MyApp.app/Contents/MacOS/MyApp, base address 100000000
obj_free (in MyApp) (somefile.c:135)

Telling me my app crashed at line 135 of somefile.c

烟火散人牵绊 2024-11-11 09:40:53

@inkjet 的上述评论值得有自己的答案。
他构建了一个应用程序,可以从 dsym 和 .crash 文件中进行完整的符号化。

我制作的 Sumbolon 的免费替代品:bch.us.to/apps/macsymbolicator — 它以与下面 Rich Able 描述的相同方式使用 atos。 – inket 2013 年 12 月 24 日 4:39

将其全部放在一起:

  1. 此处下载 Mac Symbolicator

  2. 打开 Xcode,选择窗口->管理器,转到存档选项卡并找到
    发生崩溃的应用程序版本。

  3. 右键单击应用程序存档并选择“在 Finder 中显示”

  4. 右键单击 .xarchive,选择“显示内容”并查找这
    AppName.dSYM目录

  5. 将您的 .crash 文件和 AppName.dsym 拖到 Sumbolon

  6. 魔法发生了

@inkjet 's comment above deserves its own answer.
He built an app that does a full symbolication from your dsym and .crash file.

A free alternative to Sumbolon that I made: bch.us.to/apps/macsymbolicator — It uses atos in the same way described by Rich Able below. – inket Dec 24 '13 at 4:39

putting it all together:

  1. download Mac Symbolicator from here

  2. Open Xcode, select Window->Organizer, goto the Archive tab and find
    the version of your app that experienced the crash.

  3. Right click on the app archive and select "Show in Finder"

  4. Right click on the .xarchive, select "Show Contents" and find the
    AppName.dSYM directory

  5. Drag your .crash file and AppName.dsym to Sumbolon

  6. Magic happens

童话 2024-11-11 09:40:53

此链接

此链接解释了用崩溃行号表示崩溃日志的所有内容。你只需要在同一个文件夹中有 .dsyms 文件、.app 文件和崩溃日志,

我环顾四周,发现没有比这更好的了。所以我发布它希望这对其他人有帮助。

this link

this link explains everything to symbolicate the crash log with the line no of crash. you just need to have .dsyms file, .app file and crash log in same folder

i looked around and find nothing better than this. so i am posting it by hoping this will help others.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文