dSYM文件是什么 ?

dSYM文件是什么 ?_第1张图片

Overview 概述

dSYM的全称是debug symbol, 所以dSYM文件就是debug symbol (dSYM) file, dSYM文件中的每个 debug symbol, 对应了一个关系, 这个关系一端是源代码里真实的符号(类名称、全局变量以及方法和函数名称), 另一端则是其定义的文件号和行号.

Apple Documentation 苹果文档

When Xcode compiles your source code into machine code, it generates a list of symbols1 in your app — class names, global variables, and method and function names. These symbols correspond to the file and line numbers where they’re defined; this association creates a debug symbol, so you can use the debugger in Xcode, or refer to2 line numbers reported by a crash report. Debug builds of an app place the debug symbols inside the compiled binary file by default, while release builds of an app place the debug symbols in a companion debug symbol (dSYM) file to reduce the size of the distributed app.

Each binary file in an app — the main app executable, frameworks, and app extensions — has its own dSYM file. The compiled binary and its companion dSYM file (配套dSYM文件) are tied together by a build UUID that’s recorded by both the built binary and dSYM file. If you build two binaries from the same source code but with different Xcode versions or build settings, the build UUIDs for the two binaries won’t match. A binary and a dSYM file are only compatible with each other when they have identical (完全相同的) build UUIDs. Keep the dSYM files for the specific builds you distribute, and use them when diagnosing issues from crash reports.

DWARF 是什么 ?

Xcode

熟悉 Xcode > Build Settings 的同学一定记得 Build Options > Debug Information Format 的两个选项: DWARF 和 DWARF with dSYM File
Debug Information Format

Wikipedia

DWARF3 is a widely used, standardized debugging data format. DWARF was originally designed along with Executable and Linkable Format (ELF), although it is independent of object file formats. The name is a medieval fantasy complement to “ELF” that had no official meaning, although the backronym4 “Debugging With Arbitrary Record Formats” has since been proposed.


  1. 此处的 symbol 并非指 dSYM 文件中的 debug symbol, 而是 source code 中的真实符号 ; ↩︎

  2. refer to, 这里表示"查阅", 文中的意思是根据dSYM文件内的 debug symbol, 就可以查阅 crash report 中的 line numbers 具体指的是什么 ; ↩︎

  3. DWARF in Wikipedia ; ↩︎

  4. 提到 backronym 这个词, 就不得不说 acronym, 简单来说 acronym 是取不同单字的第一个字母结合一起;而反之backronym 是先有字母再「伸展出」(回推) 不同的单字, 它是由 backwards 与acronym 组合创造而成, 感兴趣可以看下 YouTube 上的详细来龙去脉 ; ↩︎

你可能感兴趣的:(iOS开发,ios,Swift,dSYM)