# What is a symbol table

The symbol table is a mapping table between memory addresses and source file names, function names, and line numbers. The symbol table usually includes the following information:

<内存起始地址><内存结束地址><源码函数名称>[<源码文件名称:源码行号>]

After the application is officially released, the binary code no longer contains the source code information. When the application crashes (crash), the stack information when the exception occurs can be captured, but the information is represented by the memory address. At this time, it can be parsed and restored to the source code stack information through the symbol table. , so as to facilitate developers to locate and solve abnormal problems.

# What is a dsym file

On the iOS platform, a dSYM file refers to an object file with debugging information, which stores source file name, function name, line number, and other information, and corresponds to the function memory address in the executable file one-to-one. The xcarchive file published in XCode contains the dysm file by default, usually: xxxx.app.dSYM, where xxxx is the package name of the application, as shown below:

The contents of the dSYM file are:

# Purpose of dsym file

After the application is released and online, the application crash error cannot be visually seen in XCode. At this time, the crash report file needs to be analyzed. There will be a log file in the iOS device to save the function memory address of each application crash. The DeviceLog in the iOS device is exported as a crash file, and then the corresponding function name and source file name can be found in the dsym file through the function memory address.

Most statistics platforms will capture the function memory address when the application crashes and submit it to the statistics server. In order to better analyze the crash log, the dysm file is also required to find the name of the crashed function and source file name. Therefore, the statistical platform also requires developers to upload dsym files.

# Cloud packaging configuration in HBuilderX generates symbol table file

HBuilderX3.5.0+ version generates iOS symbol table dsym file configuration items are adjusted to the native App-cloud packaging window

In HBuilderX, select "Generate iOS symbol table (dsym) file" in the menu item "Release" -> "Native App-Cloud Packaging" interface:

HBuilderX from version 3.2.23 to 3.4.18 Configure the generated iOS symbol table dsym file in the manifest.json visual interface of the project

Open the manifest.json file of the project in HBuilderX, and check the "Generate iOS Symbol Table (dsym) File" in the "App Common Other Settings" interface:

Submit to the cloud after saving.

After the cloud package is successful, the dsym file download address will be output in the HBuilderX console:

# Precautions

  • The download file format is zip, and the dsym file can be obtained after decompression
  • The generation of the symbol table dsym file needs to consume the cloud package CDN resources, and the use of this function requires separate billing
  • The generated dsym file download address is valid for two days. After expiration, it is automatically deleted and cannot be restored. Please download it to a local backup as soon as possible after it is generated.