如何手动符号化 iOS 崩溃以查看崩溃日志 [英] How to Manually Symbolicate iOS Crash to View Crash Logs

查看:27
本文介绍了如何手动符号化 iOS 崩溃以查看崩溃日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试调试应用.问题是我找不到这个程序.

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

symbolicatecrash.sh

symbolicatecrash.sh

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

是单独下载吗?我正在使用 XCode 3.2.3

Is it a separate download? I am using XCode 3.2.3

谢谢.

推荐答案

EDIT :: XCode 4.3

除了少数例外,您需要按照原始答案(如下)中概述的步骤进行操作.

EDIT :: XCode 4.3

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

首先,您需要修复Xcode路径.打开终端并运行:

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

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

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

如果它显示/Developer"或除/Applications/Xcode.app/Contents/Developer/"之外的任何内容,那么它是错误的.要解决此问题,请运行以下命令:

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/

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

您现在可以运行以下所有步骤,除了 symbolicatecrash 命令位于新位置(再次).这是因为 Xcode 现在作为应用程序安装.要找到 symbolicatecrash 从终端运行这个:

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 -namesymbolatecrash -type f

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

这应该返回:

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

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

在运行 symbolicatecrash 之前,你可能希望进入这个目录:

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

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

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

<小时>

原始答案:: Xcode <4.3

symbolicatecrash 的路径

从终端搜索:

find/Developer -namesymbolatecrash -type f

find /Developer -name symbolicatecrash -type f

对我来说这返回了:

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

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

如何手动符号化崩溃日志

运行 symbolicatecrash 命令,将崩溃日志作为第一个参数,将 dSYM 文件作为第二个参数.请注意,如果您将从当前目录运行 symbolicatecrash,则您必须将 ./ 放在前面,如 ./symbolicatecrash 除非您的 PATH 环境变量包括命令所在的目录.

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.

我首先切换到包含 symbolicatecrash 命令的目录(注意:Xcode 4.3 会有所不同,见顶部):

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

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

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

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

如何查找 dSYM 文件:

您必须拥有用于在崩溃时创建构建的存档才能获取 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.

步骤如下:

  1. 右键单击(或 ctrl 单击)管理器中的存档并选择在 Finder 中显示".
  2. 从finder 中的xcarchive 文件中,右键单击(或ctrl 单击)该文件并选择显示包内容".然后您将看到一个dSYMs"文件夹.
  3. 在dSYMs"文件夹中,您会找到YourAppName.app.dSYM"文件,您需要用它来符号化文件.
  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.

这篇关于如何手动符号化 iOS 崩溃以查看崩溃日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆