Xcode 5的管理器有一个视图,可以列出所有的崩溃日志。我们可以拖放这里的崩溃日志。但自从Xcode 6以来,我知道他们已经将设备移出了组织,并为相同的设置了一个新的窗口。但我没有找到一个地方,我查看崩溃日志,我拖拽在Xcode 5后上升到Xcode 6。有人知道答案吗?
当前回答
您需要访问包含DWARF文件的. dsym包(文件夹),并且应该使用编辑器打开.crash文件。
查看回溯部分,你应该会看到如下内容:
...
13 TheElements 0x0000000100f62ca0 0x100f5c000 + 27808
14 UIKitCore 0x00000001843e3044 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 356 (UIApplication.m:2328)
...
Binary Images:
0x100f5c000 - 0x101673fff TheElements arm64 ...
...
注意stacktrace部分的第3列(0x0000000100f62ca0)中的长地址。 注意第4列中的简短地址(0x100f5c000) 注意二进制图像部分的架构(arm64) 执行以下操作:
$ atos -arch <arch> -o TheElements.app.dSYM/Contents/Resources/DWARF/TheElements -l <short_address> <long_address>
你应该得到这样的结果:
-[AtomicElementViewController myTransitionDidStop:finished:context:]
权威来源:https://developer.apple.com/library/content/technotes/tn2151/_index.html#//apple_ref/doc/uid/DTS40008184-CH1-SYMBOLICATE_WITH_ATOS
注意:如果由于任何原因你无法访问. dsym文件,你可以使用Xcode>Product>Archive重新创建.xcarchive,但要确保你构建的是完全相同的代码。然后可以从.xcarchive包中提取符号。
其他回答
您需要访问包含DWARF文件的. dsym包(文件夹),并且应该使用编辑器打开.crash文件。
查看回溯部分,你应该会看到如下内容:
...
13 TheElements 0x0000000100f62ca0 0x100f5c000 + 27808
14 UIKitCore 0x00000001843e3044 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 356 (UIApplication.m:2328)
...
Binary Images:
0x100f5c000 - 0x101673fff TheElements arm64 ...
...
注意stacktrace部分的第3列(0x0000000100f62ca0)中的长地址。 注意第4列中的简短地址(0x100f5c000) 注意二进制图像部分的架构(arm64) 执行以下操作:
$ atos -arch <arch> -o TheElements.app.dSYM/Contents/Resources/DWARF/TheElements -l <short_address> <long_address>
你应该得到这样的结果:
-[AtomicElementViewController myTransitionDidStop:finished:context:]
权威来源:https://developer.apple.com/library/content/technotes/tn2151/_index.html#//apple_ref/doc/uid/DTS40008184-CH1-SYMBOLICATE_WITH_ATOS
注意:如果由于任何原因你无法访问. dsym文件,你可以使用Xcode>Product>Archive重新创建.xcarchive,但要确保你构建的是完全相同的代码。然后可以从.xcarchive包中提取符号。
确保你的Xcode应用名称不包含任何空格。这就是它对我不起作用的原因。所以/应用程序/ Xcode。/Applications/Xcode应用程序不能工作。
对崩溃日志进行符号化的最简单方法:
在IPA构建过程中保存组织者的xcarchive文件,以备将来使用。 当崩溃发生时,从受影响的设备上收集崩溃日志。扩展名应该是.crash。如果崩溃日志是.ips格式,只需将其重命名为.crash。 双击存储路径中的xcarchive,使其出现在管理器中(如果尚未出现)。 打开xcode窗口->设备和模拟器->查看设备日志->所有日志->拖放.crash文件。
等待5秒。砰!堆栈跟踪中的应用程序调用将被符号化! 不过,你仍然可以看到很多符号!这些是内部库和框架调用。
这是最简单的一种方法,我已经试过了!
使用Xcode有一个更简单的方法(不需要使用命令行工具,一次查找一个地址)
Take any .xcarchive file. If you have one from before you can use that. If you don't have one, create one by running the Product > Archive from Xcode. Right click on the .xcarchive file and select 'Show Package Contents' Copy the dsym file (of the version of the app that crashed) to the dSYMs folder Copy the .app file (of the version of the app that crashed) to the Products > Applications folder Edit the Info.plist and edit the CFBundleShortVersionString and CFBundleVersion under the ApplicationProperties dictionary. This will help you identify the archive later Double click the .xcarchive to import it to Xcode. It should open Organizer. Go back to the crash log (in Devices window in Xcode) Drag your .crash file there (if not already present) The entire crash log should now be symbolicated. If not, then right click and select 'Re-symbolicate crash log'
在Xcode 10中遵循以下步骤,在同一台机器上生成应用程序的崩溃日志:
Inside Organizer, locate the archive where the app is based on. Click on the Download Debug Symbols button. Nothing will appear in your Downloads folder, but that's OK. Connect the build machine to an iOS device. Select the device in Devices and Simulators. Click on the View Devices Logs button. Drag-and-drop the crash file to the left panel. The file must end with a .crash extension, otherwise the drag fails. Switch to the All Logs tab. Select the added crash file. The file should automatically symbolicate, otherwise use the right-click context menu item Re-Symbolicate Log.
推荐文章
- 创建配置文件失败
- 如何在iOS中使用Swift编程segue
- Swift -整数转换为小时/分钟/秒
- Swift:声明一个空字典
- 在成功提交我的应用程序后,“太多符号文件”
- 首先添加一个UIView,甚至是导航栏
- 复制并重命名Xcode项目和相关文件夹
- 我如何改变UIButton标题颜色?
- 在Swift中如何调用GCD主线程上的参数方法?
- NSLayoutConstraints是可动画的吗?
- iOS -构建失败,CocoaPods无法找到头文件
- Xcode 4挂在“附加到(应用程序名称)”
- 为什么单元测试中的代码不能找到包资源?
- CFNetwork SSLHandshake iOS 9失败
- 请求失败:不可接受的内容类型:文本/html使用AFNetworking 2.0