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

发布于 2024-08-05 00:31:48 字数 309 浏览 8 评论 0原文

我想尝试用符号表示我的 iPhone 应用程序的崩溃报告。

我从 iTunes Connect 检索了崩溃报告。我有提交到 App Store 的应用程序二进制文件,还有作为构建的一部分生成的 dSYM 文件。

我将所有这些文件放在一个由聚光灯索引的目录中。

现在怎么办?

我尝试过调用:

symbolicatecrash crashreport.crash myApp.app.dSYM

它只输出与崩溃报告中相同的文本,而不是符号化的。

我做错了什么吗?

I'm looking to try and symbolicate my iPhone app's crash reports.

I retrieved the crash reports from iTunes Connect. I have the application binary that I submitted to the App Store and I have the dSYM file that was generated as part of the build.

I have all of these files together inside a single directory that is indexed by spotlight.

What now?

I have tried invoking:

symbolicatecrash crashreport.crash myApp.app.dSYM

and it just outputs the same text that is in the crash report to start with, not symbolicated.

Am I doing something wrong?

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

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

发布评论

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

评论(26

柠檬心 2024-08-12 00:31:48

分析苹果崩溃报告的步骤:

  1. 将推送到应用商店的 .app 版本文件、发布时创建的 .dSYM 文件以及从 APPLE 收到的崩溃报告复制到文件夹< /em>.

  2. 打开终端应用程序并转到上面创建的文件夹(使用 cd 命令)

  3. 运行atos -arch armv7 -o APPNAME.app/APPNAME MEMORY_LOCATION_OF_CRASH。根据报告,内存位置应该是应用程序崩溃的位置。

例如:atos -arch armv7 -o 'APPNAME.app'/'APPNAME' 0x0003b508

这将显示导致崩溃的确切行、方法名称。

例如:<代码>[类名函数名:]; -510

符号化 IPA

如果我们使用 IPA 进行符号化 - 只需将扩展名 .ipa 重命名为 .zip ,然后解压它,我们就可以得到一个包含 app 的 Payload 文件夹。在这种情况下,我们不需要 .dSYM 文件。

注意

仅当应用程序二进制文件未删除符号时,此功能才有效。默认情况下,发布版本会删除这些符号。我们可以在项目构建设置中将其“在复制期间剥离调试符号”更改为“否”。

更多详细信息请参阅此帖子

Steps to analyze crash report from apple:

  1. Copy the release .app file which was pushed to the appstore, the .dSYM file that was created at the time of release and the crash report receive from APPLE into a FOLDER.

  2. OPEN terminal application and go to the folder created above (using cd command)

  3. Run atos -arch armv7 -o APPNAME.app/APPNAME MEMORY_LOCATION_OF_CRASH. The memory location should be the one at which the app crashed as per the report.

Ex: atos -arch armv7 -o 'APPNAME.app'/'APPNAME' 0x0003b508

This would show you the exact line, method name which resulted in crash.

Ex: [classname functionName:]; -510

Symbolicating IPA

if we use IPA for symbolicating - just rename the extention .ipa with .zip , extract it then we can get a Payload Folder which contain app. In this case we don't need .dSYM file.

Note

This can only work if the app binary does not have symbols stripped. By default release builds stripped the symbols. We can change it in project build settings "Strip Debug Symbols During Copy" to NO.

More details see this post

待天淡蓝洁白时 2024-08-12 00:31:48

在阅读了此处所有这些答案以符号化崩溃日志(并最终成功)后,我认为这里缺少一些点,这些点对于确定为什么调用 symbolicatecrash 不会产生符号化输出非常重要。

表示崩溃日志时,必须将 3 个资源组合在一起:

  1. 崩溃日志文件本身(即 example.crash),可以从 Xcode 的管理器导出,也可以从 iTunes Connect 接收。
  2. .app 包(即 example.app)本身包含属于崩溃日志的应用程序二进制文件。如果您有 .ipa 包(即 example.ipa),那么您可以通过解压 .ipa 来提取 .app 包(即 unzip example.ipa)。之后,.app 包位于提取的 Payload/ 文件夹中。
  3. 包含调试符号的 .dSYM 包(即 example.app.dSYM

在开始符号化之前,您应该检查所有这些工件是否匹配,这意味着崩溃日志属于您拥有的二进制文件以及调试符号是在该二进制文件的构建过程中生成的。

每个二进制文件都由可在崩溃日志文件中看到的 UUID 引用:

...
Binary Images:
0xe1000 -    0x1f0fff +example armv7  <aa5e633efda8346cab92b01320043dc3> /var/mobile/Applications/9FB5D11F-42C0-42CA-A336-4B99FF97708F/example.app/example
0x2febf000 - 0x2fedffff  dyld armv7s  <4047d926f58e36b98da92ab7a93a8aaf> /usr/lib/dyld
...

在此提取中,崩溃日志属于名为 example.app/example 且 UUID aa5e633efda8346cab92b01320043dc3 的应用程序二进制映像。

您可以使用 dwarfdump 检查二进制包的 UUID:

dwarfdump --uuid example.app/example
UUID: AA5E633E-FDA8-346C-AB92-B01320043DC3 (armv7) example.app/example

然后您应该检查您拥有的调试符号是否也属于该二进制文件:

dwarfdump --uuid example.app.dSYM
UUID: AA5E633E-FDA8-346C-AB92-B01320043DC3 (armv7) example.app.dSYM/Contents/Resources/DWARF/example

在此示例中,所有资产都组合在一起,您应该能够对堆栈跟踪进行符号化。

继续执行 symbolicatecrash 脚本:

在 Xcode 8.3 中,您应该能够通过以下方式调用该脚本:

/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash -v example.crash 2> symbolicate.log

如果不存在,您可以运行 find 。 -name symbolicatecrash 在你的 Xcode.app 目录中找到它。

正如您所看到的,没有给出更多参数。因此,脚本必须通过运行聚光灯搜索来查找应用程序二进制文件和调试符号。它使用名为 com_apple_xcode_dsym_uuids 的特定索引搜索调试符号。您可以自己进行此搜索:

mdfind 'com_apple_xcode_dsym_uuids = *'

resp。

mdfind "com_apple_xcode_dsym_uuids == AA5E633E-FDA8-346C-AB92-B01320043DC3"

第一个聚光灯调用为您提供所有索引的 dSYM 包,第二个调用为您提供具有特定 UUID 的 .dSYM 包。如果聚光灯找不到您的 .dSYM 包,那么 symbolicatecrash 也不会。如果您执行所有这些操作,例如在 ~/Desktop 聚光灯的子文件夹中应该能够找到所有内容。

如果 symbolicatecrash 找到您的 .dSYM 包,symbolicate.log 中应该有类似以下内容的行:

@dsym_paths = ( <SOME_PATH>/example.app.dSYM/Contents/Resources/DWARF/example )

For find your .app< /code> 打包一个聚光灯搜索,如下所示,由 symbolicatecrash 调用:

mdfind "kMDItemContentType == com.apple.application-bundle && (kMDItemAlternateNames == 'example.app' || kMDItemDisplayName == 'example' || kMDItemDisplayName == 'example.app')"

如果 symbolicatecrash 找到您的 .app 包,则应该有以下摘录symbolicate.log

Number of symbols in <SOME_PATH>/example.app/example: 2209 + 19675 = 21884
Found executable <SOME_PATH>/example.app/example
-- MATCH

如果 symbolicatecrash 找到了所有这些资源,它应该打印出崩溃日志的符号版本。

如果没有,您可以直接传入 dSYM 和 .app 文件。

symbolicatecrash -v --dsym <SOME_PATH>/<App_URI>.app.dSYM/<APP_NAME>.app.dsym <CRASHFILE> <SOME_OTHER_PATH>/<APP_NAME>.app/<APP_NAME> > symbolicate.log

注意:符号化回溯将输出到终端,而不是symbolicate.log

After reading all these answers here in order to symbolicate a crash log (and finally succeeding) I think there are some points missing here that are really important in order to determine why the invocation of symbolicatecrash does not produce a symbolicated output.

There are 3 assets that have to fit together when symbolicating a crash log:

  1. The crash log file itself (i.e. example.crash), either exported from XCode's organizer or received from iTunes Connect.
  2. The .app package (i.e. example.app) that itself contains the app binary belonging to the crash log. If you have an .ipa package (i.e. example.ipa) then you can extract the .app package by unzipping the .ipa package (i.e. unzip example.ipa). Afterwards the .app package resides in the extracted Payload/ folder.
  3. The .dSYM package containing the debug symbols (i.e. example.app.dSYM)

Before starting symbolication you should check if all those artifacts match, which means that the crash log belongs to the binary you have and that the debug symbols are the ones produced during the build of that binary.

Each binary is referred by a UUID that can be seen in the crash log file:

...
Binary Images:
0xe1000 -    0x1f0fff +example armv7  <aa5e633efda8346cab92b01320043dc3> /var/mobile/Applications/9FB5D11F-42C0-42CA-A336-4B99FF97708F/example.app/example
0x2febf000 - 0x2fedffff  dyld armv7s  <4047d926f58e36b98da92ab7a93a8aaf> /usr/lib/dyld
...

In this extract the crash log belongs to an app binary image named example.app/example with UUID aa5e633efda8346cab92b01320043dc3.

You can check the UUID of the binary package you have with dwarfdump:

dwarfdump --uuid example.app/example
UUID: AA5E633E-FDA8-346C-AB92-B01320043DC3 (armv7) example.app/example

Afterwards you should check if the debug symbols you have also belong to that binary:

dwarfdump --uuid example.app.dSYM
UUID: AA5E633E-FDA8-346C-AB92-B01320043DC3 (armv7) example.app.dSYM/Contents/Resources/DWARF/example

In this example all assets fit together and you should be able to symbolicate your stacktrace.

Proceeding to the symbolicatecrash script:

In Xcode 8.3 you should be able to invoke the script via

/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash -v example.crash 2> symbolicate.log

If it is not there you may run a find . -name symbolicatecrash in your Xcode.app directory to find it.

As you can see there are no more parameters given. So the script has to find your application binary and debug symbols by running a spotlight search. It searches the debug symbols with a specific index called com_apple_xcode_dsym_uuids. You can do this search yourself:

mdfind 'com_apple_xcode_dsym_uuids = *'

resp.

mdfind "com_apple_xcode_dsym_uuids == AA5E633E-FDA8-346C-AB92-B01320043DC3"

The first spotlight invocation gives you all indexed dSYM packages and the second one gives you the .dSYM packages with a specific UUID. If spotlight does not find your .dSYM package then symbolicatecrash will neither. If you do all this stuff e.g. in a subfolder of your ~/Desktop spotlight should be able to find everything.

If symbolicatecrash finds your .dSYM package there should be a line like the following in symbolicate.log:

@dsym_paths = ( <SOME_PATH>/example.app.dSYM/Contents/Resources/DWARF/example )

For finding your .app package a spotlight search like the following is invoked by symbolicatecrash:

mdfind "kMDItemContentType == com.apple.application-bundle && (kMDItemAlternateNames == 'example.app' || kMDItemDisplayName == 'example' || kMDItemDisplayName == 'example.app')"

If symbolicatecrash finds your .app package there should be the following extract in symbolicate.log:

Number of symbols in <SOME_PATH>/example.app/example: 2209 + 19675 = 21884
Found executable <SOME_PATH>/example.app/example
-- MATCH

If all those resources are found by symbolicatecrash it should print out the symbolicated version of your crash log.

If not you can pass in your dSYM and .app files directly.

symbolicatecrash -v --dsym <SOME_PATH>/<App_URI>.app.dSYM/<APP_NAME>.app.dsym <CRASHFILE> <SOME_OTHER_PATH>/<APP_NAME>.app/<APP_NAME> > symbolicate.log

Note: The symbolicated backtrace will be output to terminal, not symbolicate.log.

坏尐絯 2024-08-12 00:31:48

使用最新版本的 Xcode (3.2.2),您可以将任何崩溃报告拖放到 Xcode Organizer 的设备日志部分,它们将自动为您进行符号化。我认为如果您使用 Build & 构建该版本的应用程序,效果最好。存档(也是 Xcode 3.2.2 的一部分)

With the latest version of Xcode (3.2.2), you can drag and drop any crash reports into the Device Logs section of the Xcode Organiser and they will automatically by symbolicated for you. I think this works best if you built that version of the App using Build & Archive (also part of Xcode 3.2.2)

蝶…霜飞 2024-08-12 00:31:48

我使用以下步骤成功完成了此操作。

第1步:在桌面上创建一个文件夹,我将其命名为“CrashReport”并放入三个文件(“MYApp.app”、“MyApp.app.dSYM”、“MYApp_2013-07-18.dSYM”)。崩溃”)。

第 2 步: 打开 Finder 并转到“应用程序”,您将在其中找到 Xcode 应用程序,右键单击该应用程序并单击“显示包内容”,然后按照此简单路径操作。
“内容->开发者->平台->iPhoneOS.platform->开发者->库->PrivateFrameworks->DTDeviceKit.framework->版本->A- >资源”

“内容->开发者->平台->iPhoneOS.platform->开发者->库->PrivateFrameworks->DTDeviceKitBase.framework->版本->A->Resources"

或者

对于 Xcode 6 及以上版本,路径为
Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources

在您找到“symbolicatecrash”文件的位置,将其复制并粘贴到“CrashReport”文件夹中。

第 3 步:启动终端,运行以下 3 个命令

  1. cd /Users/mac38/Desktop/CrashReport 并按 Enter 按钮

  2. 导出 DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer" 并按 Enter

  3. ./symbolicatecrash -A - v MYApp_2013-07-18.crash MyApp.app.dSYM 并按 Enter 现在完成..(注意:6.4 左右或更高版本没有 -A 选项 - 只需将其省略)。

I did this successfully, using the following steps.

Step 1: Create a folder in desktop, I give name it to "CrashReport" and put three files ("MYApp.app", "MyApp.app.dSYM", "MYApp_2013-07-18.crash") in it.

Step 2: Open Finder and go to Applications, where you will find the Xcode application, right click on this and Click "Show Package Contents", after this follow this simple path.
"Contents->Developer->Platforms->iPhoneOS.platform->Developer->Library->PrivateFrameworks->DTDeviceKit.framework->Versions->A->Resources"

OR

"Contents->Developer->Platforms->iPhoneOS.platform->Developer->Library->PrivateFrameworks->DTDeviceKitBase.framework->Versions->A->Resources"

OR

For Xcode 6 and above the path is
Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources

Where you find "symbolicatecrash" file, copy this and paste it to "CrashReport" folder.

Step 3: launch the terminal, run these 3 Command

  1. cd /Users/mac38/Desktop/CrashReport and press Enter button

  2. export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer" and press Enter

  3. ./symbolicatecrash -A -v MYApp_2013-07-18.crash MyApp.app.dSYM and press Enter Now its Done.. (NOTE: versions around 6.4 or later do not have the -A option -- just leave it out).
孤云独去闲 2024-08-12 00:31:48

使用 XCode 自动符号化崩溃报告的步骤:

已更新 XCODE 9

  1. 任何 iOS 设备连接到您的 Mac(是的,物理设备) ,是的,我知道这很愚蠢)

  2. 选择“窗口”菜单中的“设备”
    输入图像描述此处

  3. 在左侧单击您的设备,然后在右侧查看设备日志
    输入图像描述此处

  4. 等等。可能需要一分钟才会出现。也许执行Command-A然后Delete会加快速度。

  5. 未记录的关键步骤:将从 iTunesConnect 获得的崩溃报告从 .txt 扩展名重命名为 .crash 扩展名

  6. 将崩溃报告拖到左侧的区域
    输入图像描述这里

然后 Xcode 会符号化崩溃报告并显示结果。

来源:https://developer.apple.com/library/ios/technotes /tn2151/_index.html

Steps to symbolicate a crash report automatically using XCode:

UPDATED FOR XCODE 9

  1. Connect any iOS device to your Mac (yes a physical one, yes I know this is stupid)

  2. Choose "Devices" from the "Window" menu
    enter image description here

  3. Click your device on the left and VIEW DEVICE LOGS on the right
    enter image description here

  4. Wait. It might take a minute to show up. Maybe doing Command-A then Delete will speed this up.

  5. Critical undocumented step: rename the crash report that you got from iTunesConnect from .txt extension to .crash extension

  6. Drag the crash report into that area on the left
    enter image description here

And then Xcode will symbolicate the crash report and display the results.

Source: https://developer.apple.com/library/ios/technotes/tn2151/_index.html

梦纸 2024-08-12 00:31:48

我在我的应用程序中使用 Airbrake,它在远程错误记录方面做得相当好。

如果回溯需要的话,我是这样用 atos 来符号化它们的:

  1. 在 Xcode (4.2) 中转到组织器,右键单击来自的存档
    生成了 .ipa 文件。

  2. 在终端中,cd 进入 xcarchive 例如 MyCoolApp 10-27-11 1.30 PM.xcarchive

  3. 输入以下atos -arch armv7 -o 'MyCoolApp.app'/'MyCoolApp'
    (不要忘记单引号)

  4. 我没有在该调用中包含我的符号。您得到的是空行上的块光标。

  5. 然后我将符号代码复制/粘贴到该块光标处并按
    进入。您会看到类似以下内容:

    -[MyCoolVC dealloc](在 MyCoolApp 中)(MyCoolVC.m:34)

  6. 您返回到块光标,可以粘贴其他符号。

能够在不重新输入第一位的情况下遍历回溯一个项目,可以节省大量时间。

享受!

I use Airbrake in my apps, which does a fairly good job of remote error logging.

Here's how I symbolicate them with atos if the backtrace needs it:

  1. In Xcode (4.2) go to the organizer, right click on the archive from
    which the .ipa file was generated.

  2. In Terminal, cd into the xcarchive for instance MyCoolApp 10-27-11 1.30 PM.xcarchive

  3. Enter the following atos -arch armv7 -o 'MyCoolApp.app'/'MyCoolApp'
    (don't forget the single quotes)

  4. I don't include my symbol in that call. What you get is a block cursor on an empty line.

  5. Then I copy/paste my symbol code at that block cursor and press
    enter. You'll see something like:

    -[MyCoolVC dealloc] (in MyCoolApp) (MyCoolVC.m:34)

  6. You're back to a block cursor and you can paste in other symbols.

Being able to go through your backtrace one item without re-entering the first bit is a nice time saver.

Enjoy!

好倦 2024-08-12 00:31:48

在运行 symbolicate crash 之前,我还将 dsym、应用程序包和崩溃日志放在同一目录中。

然后,我使用 .profile 中定义的这个函数来简化运行 symbolicatecrash:

function desym
{
    /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash -A -v $1 | more
}

那里添加的参数可能会对您有所帮助。

您可以通过运行以下命令来检查以确保聚光灯“看到”您的 Dym 文件:

mdfind 'com_apple_xcode_dsym_uuids = *'

查找目录中的 dsym。

注意:从最新的 Xcode 开始,不再有 Developer 目录。您可以在这里找到此实用程序:

/Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Vers‌ ions/A/Resources/symbolicatecrash

I also put dsym, app bundle, and crash log together in the same directory before running symbolicate crash

Then I use this function defined in my .profile to simplify running symbolicatecrash:

function desym
{
    /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash -A -v $1 | more
}

The arguments added there may help you.

You can check to make sure spotlight "sees" your dysm files by running the command:

mdfind 'com_apple_xcode_dsym_uuids = *'

Look for the dsym you have in your directory.

NOTE: As of the latest Xcode, there is no longer a Developer directory. You can find this utility here:

/Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Vers‌​ions/A/Resources/symbolicatecrash

暮倦 2024-08-12 00:31:48

只是 xcode 6.1.1 的简​​单且更新的答案。

步骤

1.Xcode>窗口>设备。

2.从“设备”部分下的设备列表中选择一个设备。

3.选择查看设备日志。

4.在“所有日志”部分下,您可以直接拖放报告。崩溃

5.Xcode 将自动为您符号化崩溃报告。

6.您可以通过将其日期/时间与崩溃报告中提到的日期/时间进行匹配来找到符号化的崩溃报告。

Just a simple and updated answer for xcode 6.1.1 .

STEPS

1.Xcode>Window>Devices.

2.Select a device from a list of devices under DEVICES section.

3.Select View Device Logs.

4.Under the All Logs section you can directly drag drop the report.crash

5.Xcode will automatically Symbolicate the crash report for you.

6.You can find the Symbolicated crash report by matching its Date/Time with the Date/Time mentioned in your crash report.

红ご颜醉 2024-08-12 00:31:48

尽管我已经开发应用程序几年了,但这是我第一次调试二进制文件,我感觉自己像个菜鸟一样弄清楚所有文件在哪里,即 *.app *.dSYM 和崩溃日志在哪里?我必须阅读多篇文章才能弄清楚。图片胜过一千字,我希望这篇文章对未来的其他人有所帮助。

1- 首先转到 itunesconnect 并下载崩溃日志。
注意:在大多数情况下,您可能会收到类似“提交的报告太少,无法显示报告”的信息。基本上没有足够的用户向 Apple 提交了崩溃日志报告,在这种情况下,您此时无能为力。

在此处输入图像描述

在此处输入图像描述

2- 现在,如果您在将二进制文件提交给 Apple 后没有更改过代码,则为该项目启动 Xcode 并执行 Product -->;再次存档。否则,只需找到您最新提交的二进制文件并右键单击它即可。

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

Even though I had been developing apps for a few years now, this was my first time debugging a binary and I felt like a complete NOOB figuring out where all the files were i.e. where is *.app *.dSYM and crash logs? I had to read multiple posts in order to figure it out. Picture is worth a thousand words and I hope this post helps anyone else in future.

1- First go to itunesconnect and download your crash logs.
NOTE: Is most cases you may get something like "Too few reports have been submitted for a report to be shown." Basically not enough users have submitted crash log reports to Apple in which case you can't do much of anything at that point.

enter image description here

enter image description here

2- Now if you had not changed your code since you had submitted your binary it to Apple then Launch Xcode for that project and do Product --> Archive again. Otherwise just find your latest submitted binary and right click on it.

enter image description here

enter image description here

enter image description here

enter image description here

最单纯的乌龟 2024-08-12 00:31:48

在 Xcode 4.2.1 中,打开管理器,然后转到库/设备日志并将 .crash 文件拖到崩溃日志列表中。几秒钟后,它将为您显示符号。

请注意,您必须使用原始构建存档所在的 Xcode 实例(即构建的存档必须存在于 Organizer 中)。

In Xcode 4.2.1, open Organizer, then go to Library/Device Logs and drag your .crash file into the list of crash logs. It will be symbolicated for you after a few seconds.

Note that you must use the same instance of Xcode that the original build was archived on (i.e. the archive for your build must exist in Organizer).

零度℉ 2024-08-12 00:31:48

使用 Xcode 4,任务甚至更简单:

  • 打开管理器
  • 单击左栏中的库 | 设备日志,然后
  • 单击“导入” “屏幕底部的按钮...

瞧。日志文件会自动为您导入并符号化。假设您使用 Xcode 存档了构建 ->产品->首先存档。

Using Xcode 4, the task is even simpler:

  • open Organizer,
  • click on Library | Device Log in the left column
  • click on "Import" button on the bottom of the screen...

and voilà. The log file is imported and Symbolized automatically for you. Provided you Archived the build using Xcode -> Product -> Archive first.

静谧 2024-08-12 00:31:48

神奇的 Xcode Organizer 对于象征我的应用程序来说并没有那么神奇。对于我从 Apple 收到的因应用程序提交失败而返回的崩溃报告,我根本没有收到任何符号。

我尝试使用命令行,将崩溃报告放在与 .app 文件(我提交到商店)和 .dSYM 文件相同的文件夹中:

$ symbolicatecrash "My App_date_blahblah-iPhone.crash" "My App.app"

这仅为我的应用程序提供了符号,而不是核心基础代码,但是它比组织者给我的数字转储要好,足以让我找到并修复我的应用程序发生的崩溃。如果有人知道如何扩展它以获得基金会符号,我们将不胜感激。

The magical Xcode Organizer isn't that magical about symbolicating my app. I got no symbols at all for the crash reports that I got back from Apple from a failed app submission.

I tried using the command-line, putting the crash report in the same folder as the .app file (that I submitted to the store) and the .dSYM file:

$ symbolicatecrash "My App_date_blahblah-iPhone.crash" "My App.app"

This only provided symbols for my app and not the core foundation code, but it was better than the number dump that Organizer is giving me and was enough for me to find and fix the crash that my app had. If anyone knows how to extend this to get Foundation symbols it would be appreciated.

最好是你 2024-08-12 00:31:48

就我而言,我将崩溃报告直接从邮件拖到组织者中。由于某种原因,这阻止了崩溃报告被符号化(我很想知道为什么)。

首先将崩溃报告复制到桌面,然后将它们从那里拖到管理器中,使它们正确地符号化。

非常具体的案例,我知道。但我想我会分享以防万一。

In my case, I was dragging crash reports directly from Mail to the Organizer. For some reason, that prevented the crash reports from getting symbolicated (I'd love to know why).

Copying the crash reports to the Desktop first, and then dragging them from there to the Organizer got them symbolicated properly.

Very specific case, I know. But thought I'd share just in case.

俯瞰星空 2024-08-12 00:31:48

这是我在使用symbolicatecrash时遇到的另一个问题——它不适用于捆绑包中有空格的应用程序(即“Test App.app”)。请注意,我认为提交时名称中不能包含空格,因此您应该删除这些空格,但如果您已经有需要分析的崩溃,请修补 symbolicatecrash (4.3 GM),如下所示:

240c240
<         my $cmd = "mdfind \"kMDItemContentType == com.apple.application-bundle && kMDItemFSName == $exec_name.app\"";
---
>         my $cmd = "mdfind \"kMDItemContentType == com.apple.application-bundle && kMDItemFSName == '$exec_name.app'\"";
251c251
<             my $cmd = "find \"$archive_path/Products\" -name $exec_name.app";
---
>             my $cmd = "find \"$archive_path/Products\" -name \"$exec_name.app\"";

Here's another issue I have with symbolicatecrash – it won't work with Apps that have spaces in their bundle (i.e. 'Test App.app'). Note I don't think you can have spaces in their name when submitting so you should remove these anyway, but if you already have crashes that need analysing, patch symbolicatecrash (4.3 GM) as such:

240c240
<         my $cmd = "mdfind \"kMDItemContentType == com.apple.application-bundle && kMDItemFSName == $exec_name.app\"";
---
>         my $cmd = "mdfind \"kMDItemContentType == com.apple.application-bundle && kMDItemFSName == '$exec_name.app'\"";
251c251
<             my $cmd = "find \"$archive_path/Products\" -name $exec_name.app";
---
>             my $cmd = "find \"$archive_path/Products\" -name \"$exec_name.app\"";
岁月蹉跎了容颜 2024-08-12 00:31:48

对于那些使用 Airbrake 的人来说,上面有一个可靠的响应,但如果不进行调整,它对我不起作用:

适用于某些内存地址,但不适用于其他内存地址,不知道为什么...

  • 在桌面上或任何地方
  • 在 Xcode 管理器中查找有问题的存档
  • 双击以在查找器中显示
  • 双击以显示捆绑包内容
  • 将 .dSYM 文件和 .app 文件复制到新目录
  • cd 到新目录
  • 运行此命令:atos -arch armv7 -o 'Vimeo.app'/'Vimeo'
  • 终端将输入交互式移动
  • 粘贴到内存地址并按回车键,它将输出方法名称和行号
  • 或者,输入以下命令:atos -arch armv7 -o 'Vimeo.app'/'Vimeo'
    仅获取一个地址的信息

For those using Airbrake, there's a solid response above but it wouldn't work for me without tweaking:

Works for some memory addresses but not others, not sure why...

  • Create new dir on desktop or wherever
  • Find archive in question in Xcode organizer
  • Double tap to reveal in finder
  • Double tap to show bundle contents
  • Copy .dSYM file and .app file into new dir
  • cd into new dir
  • Run this command: atos -arch armv7 -o 'Vimeo.app'/'Vimeo'
  • Terminal will enter an interactive move
  • Paste in memory address and hit enter, it will output method name and line number
  • Alternatively, enter this command: atos -arch armv7 -o 'Vimeo.app'/'Vimeo'
    To get info for one address only
等待圉鍢 2024-08-12 00:31:48

对我有用的组合是:

  1. 将 dSYM 文件复制到崩溃报告所在的目录中
  2. 解压包含应用程序的 ipa 文件(“unzip MyApp.ipa”)
  3. 将应用程序二进制文件从生成的分解有效负载复制到与应用程序相同的文件夹中崩溃报告和符号文件(类似于“MyApp.app/MyApp”)
  4. 使用 atos从 Xcode 管理器中导入或重新符号化崩溃报告

我无法使用以下命令解析正确的符号信息崩溃报告中的地址和偏移量。当我这样做时,我看到了一些更有意义的东西,它似乎是一个合法的堆栈跟踪。

The combination that worked for me was:

  1. Copy the dSYM file into the directory where the crash report was
  2. Unzip the ipa file containing the app ('unzip MyApp.ipa')
  3. Copy the application binary from the resulting exploded payload into the same folder as the crash report and symbol file (Something like "MyApp.app/MyApp")
  4. Import or Re-symbolicate the crash report from within Xcode's organizer

Using atos I wasn't able to resolve the correct symbol information with the addresses and offsets that were in the crash report. When I did this, I see something more meaningful, and it seems to be a legitimate stack trace.

情绪 2024-08-12 00:31:48

我必须对 symbolicatecrash 脚本进行大量修改才能使其正常运行。

据我所知,symbolicatecrash 现在要求 .app 与 .dsym 位于同一目录中。它将使用 .dsym 来查找 .app,但不会使用 dsym 来查找符号。

在尝试这些补丁之前,您应该复制您的 symbolicatecrash,这将使其在 dsym 中显示:

在 getSymbolPathFor_dsymUuid 函数中的第 212 行周围

212     my @executablePath = grep { -e && ! -d } glob("$dsymdir" . "/Contents/Resources/DWARF/" . $executable);

在 matchesUUID 函数中的第 265 行周围

265             return 1;

I had to do a lot of hacking of the symbolicatecrash script to get it to run properly.

As far as I can tell, symbolicatecrash right now requires the .app to be in the same directory as the .dsym. It will use the .dsym to locate the .app, but it won't use the dsym to find the symbols.

You should make a copy of your symbolicatecrash before attempting these patches which will make it look in the dsym:

Around line 212 in the getSymbolPathFor_dsymUuid function

212     my @executablePath = grep { -e && ! -d } glob("$dsymdir" . "/Contents/Resources/DWARF/" . $executable);

Around line 265 in the matchesUUID function

265             return 1;
智商已欠费 2024-08-12 00:31:48

这很简单,经过大量搜索后,我找到了表示整个崩溃日志文件的明确步骤。

  • 将 .app 、 crash_report 和 DSYM 文件复制到文件夹中。
  • 使用 xcode 连接设备
  • 然后进入窗口 ->选择设备->查看设备日志
  • 然后选择该设备,删除所有日志。
  • 将崩溃拖放到设备日志部分。它会自动象征崩溃。只需右键单击报告并将其导出即可。

快乐编码,
里亚兹

This is simple, after searching a lot i found clear steps to symbolicate whole crash log file.

  • copy .app , crash_report and DSYM files in a folder.
  • connect the device with xcode
  • Then go to window -> select devices -> view device logs
  • Then select this device, delete all logs .
  • drag and drop your crash on device log section . it will automatically symbolicate the crash . just right click on report and export it .

happy coding,
Riyaz

心舞飞扬 2024-08-12 00:31:48

我更喜欢一个能够代表我所有崩溃日志的脚本

先决条件

创建一个文件夹并放入 4 个东西:

  1. symbolicatecrash perl 脚本 - 有很多 SO 答案告诉它的位置

  2. 与崩溃匹配的构建的存档(来自Xcode Organizer。简单如在Finder中显示并复制)[我不确定这是必要的]< /p>

  3. 所有 xccrashpoint 软件包 -(来自 Xcode Organizer。在 Finder 中显示,您可以复制目录中的所有软件包,或您想要符号化的单个 xccrashpoint)

  4. 添加目录的短脚本:

    <前><代码>#!/bin/sh

    echo“从目录中清除旧的崩溃”
    rm -P *.crash
    rm -P *.xccrashpoint
    rm -r 所有崩溃
    回声“已删除!”
    回声“”
    回声“---开始---”
    回声“”

    mkdir all崩溃
    mkdir 符号崩溃
    找到 `ls -d *.xccrashpoint` -name "*.crash" -print -exec cp {} allCrashes/ \;

    cd 全部崩溃
    对于 *.crash 中的崩溃;做
    ../symbolicatecrash $crash > ../symboledCrashes/V$crash
    完毕
    光盘 ..

    回声“”
    回声“---完成---”
    回声“”

脚本

当您运行该脚本时,您将获得 2 个目录。

  1. allCrashes - 来自所有 xccrashpoint 的所有崩溃都会在那里。

  2. symboledCrashes - 相同的崩溃,但现在包含所有符号。

  3. 在运行脚本之前,您不需要清除目录中的旧崩溃。它会自动清洁。祝你好运!

I prefer a script that will symbolicate all my crash logs.

Preconditions

Create a folder and put there 4 things:

  1. symbolicatecrash perl script - there are many SO answers that tells it's location

  2. The archive of the build that match the crashes (from Xcode Organizer. simple as Show in Finder and copy) [I don't sure this is necessery]

  3. All the xccrashpoint packages - (from Xcode Organizer. Show in Finder, you may copy all the packages in the directory, or the single xccrashpoint you would like to symbolicate)

  4. Add that short script to the directory:

    #!/bin/sh
    
    echo "cleaning old crashes from directory"
    rm -P *.crash
    rm -P *.xccrashpoint
    rm -r allCrashes
    echo "removed!"
    echo ""
    echo "--- START ---"
    echo ""
    
    mkdir allCrashes
    mkdir symboledCrashes
    find `ls -d *.xccrashpoint` -name "*.crash" -print -exec cp {} allCrashes/ \;
    
    cd allCrashes
    for crash in *.crash; do
        ../symbolicatecrash $crash > ../symboledCrashes/V$crash
    done
    cd ..
    
    echo ""
    echo "--- DONE ---"
    echo ""
    

The Script

When you run the script, you'll get 2 directories.

  1. allCrashes - all the crashes from all the xccrashpoint will be there.

  2. symboledCrashes - the same crashes but now with all the symbols.

  3. you DON'T need to clean the directory from old crashes before running the script. it will clean automatically. good luck!

逆光下的微笑 2024-08-12 00:31:48

我发现大多数建议的替代方案在最新的 XCode 中不起作用(使用 Xcode 10 进行测试)。例如,我没有运气在 Xcode 中拖放 .crash 日志 ->主办方->设备日志-查看。

我建议使用Symbolicator工具https://github.com/agentsim/Symbolicator

  • Git克隆Symbolicator存储库并编译并使用 Xcode 运行
  • 复制 .​​crash 文件(ascii 文件,在文件请求中带有堆栈跟踪)和崩溃版本的 .xarchive 到同一个临时文件夹
  • 将 .crash 文件拖放到 Dock 中的 Symbolicator 图标
  • 在 5-30 秒内,符号化的崩溃文件是与 .crash 和 .xarchive 生成​​在同一文件夹中

I found out most of proposed alternatives did not work in latest XCode (tested with Xcode 10). For example, I had no luck drag-dropping .crash logs in Xcode -> Organizer -> Device logs -view.

I recommend using Symbolicator tool https://github.com/agentsim/Symbolicator

  • Git clone Symbolicator repository and compile and run with Xcode
  • Copy .crash file (ascii file, with stack trace in begging of file) and .xarchive of crashing release to same temporarly folder
  • Drag and drop .crash file to Symbolicator icon in Dock
  • In 5-30 secs symbolicated crash file is produced in same folder as .crash and .xarchive are
罪#恶を代价 2024-08-12 00:31:48

为了象征崩溃,Spotlight 必须能够找到与您提交给 Apple 的二进制文件同时生成的 .dSYM 文件。由于它包含符号信息,如果它不可用,您将不走运。

In order to symbolicate crashes, Spotlight must be able to find the .dSYM file that was generated at the same time the binary you submitted to Apple was. Since it contains the symbol information, you will be out of luck if it isn't available.

小ぇ时光︴ 2024-08-12 00:31:48

我对这里似乎没有“正常工作”这一事实感到有点脾气,所以我做了一些调查,结果是:

设置:接收报告的 QuincyKit 后端。没有设置符号,因为我什至无法开始弄清楚他们建议我做什么才能使其发挥作用。

修复:从服务器在线下载崩溃报告。它们被称为“崩溃”,默认情况下进入 ~/Downloads/ 文件夹。考虑到这一点,这个脚本将“做正确的事情”,崩溃报告将进入 Xcode(组织器、设备日志),并且符号化将完成。

脚本:

#!/bin/bash
# Copy crash reports so that they appear in device logs in Organizer in Xcode

if [ ! -e ~/Downloads/crash ]; then 
   echo "Download a crash report and save it as $HOME/Downloads/crash before running this script."
   exit 1
fi

cd ~/Library/Logs/CrashReporter/MobileDevice/
mkdir -p actx # add crash report to xcode abbreviated
cd actx

datestr=`date "+%Y-%m-%d-%H%M%S"`

mv ~/Downloads/crash "actx-app_"$datestr"_actx.crash"

如果您确实使用 QuincyKit/PLCR,则可以通过执行两件事将事情自动化到您可以在 Xcode Organizer 中拖放的位置。

首先,你必须编辑远程脚本 admin/actionapi.php ~line 202。它似乎没有得到正确的时间戳,所以文件最终以 Xcode 无法识别的名称“crash”(它想要一些东西) dot crash):

header('Content-Disposition: attachment; filename="crash'.$timestamp.'.crash"');

其次,在 QuincyKit BWCrashReportTextFormatter.m ~line 176 的 iOS 端,将 @"[TODO]" 更改为 @"TODO" 来解决这个问题人物。

I got a bit grumpy about the fact nothing here seems to "just work" so I did some investigating and the result is:

Set up: QuincyKit back end that receives reports. No symbolication set up as I couldn't even begin to figure out what they were suggesting I do to make it work.

The fix: download crash reports from the server online. They're called 'crash' and by default go into the ~/Downloads/ folder. With that in mind, this script will "do the right thing" and the crash reports will go into Xcode (Organizer, device logs) and symbolication will be done.

The script:

#!/bin/bash
# Copy crash reports so that they appear in device logs in Organizer in Xcode

if [ ! -e ~/Downloads/crash ]; then 
   echo "Download a crash report and save it as $HOME/Downloads/crash before running this script."
   exit 1
fi

cd ~/Library/Logs/CrashReporter/MobileDevice/
mkdir -p actx # add crash report to xcode abbreviated
cd actx

datestr=`date "+%Y-%m-%d-%H%M%S"`

mv ~/Downloads/crash "actx-app_"$datestr"_actx.crash"

Things can be automated to where you can drag and drop in Xcode Organizer by doing two things if you do use QuincyKit/PLCR.

Firstly, you have to edit the remote script admin/actionapi.php ~line 202. It doesn't seem to get the timestamp right, so the file ends up with the name 'crash' which Xcode doesn't recognize (it wants something dot crash):

header('Content-Disposition: attachment; filename="crash'.$timestamp.'.crash"');

Secondly, in the iOS side in QuincyKit BWCrashReportTextFormatter.m ~line 176, change @"[TODO]" to @"TODO" to get around the bad characters.

梅窗月明清似水 2024-08-12 00:31:48

atos 已被弃用,因此如果您运行的是 OSX 10.9 或更高版本,您可能需要运行

xcrun atos

警告:/usr/bin/atos 正在移动并将从未来的操作系统中删除
X 发布。现在可以在 Xcode 开发者工具中使用
通过以下方式调用:xcrun atos

atos is being deprecated so if you are running OSX 10.9 or later you may need to run

xcrun atos

Warning: /usr/bin/atos is moving and will be removed from a future OS
X release. It is now available in the Xcode developer tools to be
invoked via: xcrun atos

新一帅帅 2024-08-12 00:31:48

我喜欢使用 Textwrangler 来查明原始应用程序上传二进制拒绝中的错误。 (崩溃数据可以在您的 itunesConnect 帐户中找到。)使用上面 Sachin 的方法,我将 original.crash 复制到 TextWrangler,然后将我创建的 symbolicatecrash 文件复制到另一个 TextWrangler 文件。比较两个文件可以找出差异。 symbolicatecrash 文件会有差异,指出问题的文件和行号。

I like to use Textwrangler to pinpoint errors in an original app upload binary rejection. (The crash data will be found in your itunesConnect account.) Using Sachin's method above I copy the original.crash to TextWrangler, then copy the symbolicatecrash file I've created to another TextWrangler file. Comparing the two files pinpoints differences. The symbolicatecrash file will have differences which point out the file and line number of problems.

转角预定愛 2024-08-12 00:31:48

对于那些在 2022 年寻找可行解决方案的人

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

  • 将 Apple 提供的 .txt 格式的崩溃日志转换为 .crash
  • <代码>Xcode>窗口>设备和模拟器
  • 必须选择已连接的设备和模拟器运行 ios 设备。(不是模拟器或离线设备)
  • 选择所有日志部分,将其拖至删除 .crash 文件

请注意,具有 symbolicatecrash 的其他解决方案已被弃用,其用法如下:

⚠️ symbolicatecrash 已弃用;它将在 Xcode 的未来版本中删除⚠️

For those looking for a working solution in 2022

Steps to Symbolicating iPhone App Crash Reports

  • Convert apple provided crash log in .txt format to .crash
  • Xcode > Window > Devices and simulators
  • Must select a connected & running ios device. (not a simulator, or offline device)
  • Select All Logs section, drag & drop the .crash file

Note that, the other solutions having symbolicatecrash is deprecated and its usage shows:

⚠️ symbolicatecrash is deprecated; it will be removed in future releases of Xcode ⚠️

℉絮湮 2024-08-12 00:31:48

我们使用Google Crashlytics来监管崩溃日志,感觉非常及时且使用方便。

文档链接:
https://docs.fabric.io/apple/crashlytics/ missing-dsyms.html#missing-dsyms

关于缺失 dSYM 的所有内容
Fabric 包含一个自动上传项目 dSYM 的工具。该工具通过 /run 脚本执行,该脚本在入门过程中添加到您的运行脚本构建阶段。但是,在某些情况下,由于独特的项目配置或您在应用程序中使用 Bitcode,dSYM 上传可能会失败。当上传失败时,Crashlytics 无法符号化和显示崩溃,并且“缺少 dSYM”警报将出现在 Fabric 仪表板上。

可以按照下述步骤手动上传缺少的 dSYM。

笔记:
作为自动 dSYM 上传工具的替代方案,Fabric 提供了一个命令行工具 (upload-symbols)),可以手动配置该工具作为项目构建过程的一部分运行。有关配置说明,请参阅下面的上传符号部分。

...

We use Google Crashlytics to supervise crash logs, the feeling is very timely and convenient to use.

Document links:
https://docs.fabric.io/apple/crashlytics/missing-dsyms.html#missing-dsyms

All about Missing dSYMs
Fabric includes a tool to automatically upload your project’s dSYM. The tool is executed through the /run script, which is added to your Run Script Build Phase during the onboarding process. There can be certain situations however, when dSYM uploads fail because of unique project configurations or if you’re using Bitcode in your app. When an upload fails, Crashlytics isn’t able to symbolicate and display crashes, and a “Missing dSYM” alert will appear on your Fabric dashboard.

Missing dSYMs can be manually uploaded following the steps outlined below.

Note:
As an alternative to the automated dSYM upload tool, Fabric provides a command-line tool (upload-symbols)) that can be manually configured to run as part of your project’s build process. See the upload-symbols section below for configuration instructions.

...

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