简体   繁体   English

如何创建.dSYM文件?

[英]How is a .dSYM file created?

I'm working on an app with another developer and they just submitted a release to the app store that was built on their computer. 我正在与另一位开发人员合作开发一款应用,他们只是向他们的计算机上构建的应用商店提交了一个版本。 In order to make a build on my machine (that belongs to the same git commit), I have to alter the path to one of the libraries we use in my XCode project. 为了在我的机器上构建(属于同一个git commit),我必须改变我们在XCode项目中使用的库之一的路径。 Will any changes I make to the XCode project file change the dSYM? 我对XCode项目文件所做的任何更改是否会更改dSYM? If I was able to make a build without modifying the XCode project file, would the dSYM file be the same? 如果我能够在不修改XCode项目文件的情况下进行构建,那么dSYM文件是否相同?

A dSYM file is a "debug symbols file". dSYM文件是“调试符号文件”。 It is generated when the "Strip Debug Symbols" setting is enabled in the build settings of your project. 在项目的构建设置中启用“Strip Debug Symbols”设置时生成。

When this setting is enabled, symbol names of your objects are removed from the resulting compiled binary (one of the many countermeasures to try and prevent would be hackers/crackers from reverse engineering your code, amongst other optimisations for binary size, etc.). 启用此设置后,将从生成的编译二进制文件中删除对象的符号名称(尝试和阻止的许多对策之一是黑客/破解程序对代码进行逆向工程,以及二进制大小的其他优化等)。

dSYM files will likely change each time your app is compiled (probably every single time due to date stamping), and have nothing to do with the project settings. dSYM文件可能会在每次编译应用程序时更改(可能每次都由于日期戳),并且与项目设置无关。

They are useful for re-symbolicating your crash reports. 它们可用于重新标记崩溃报告。 With a stripped binary, you won't be able to read any crash reports without first re-symbolicating them. 使用剥离的二进制文件,如果没有首先重新符号化,您将无法读取任何崩溃报告。 Without the dSYM the crash report will just show memory addresses of objects and methods. 如果没有dSYM,崩溃报告将只显示对象和方法的内存地址。 Xcode uses the dSYM to put the symbols back into the crash report and allow you to read it properly. Xcode使用dSYM将符号放回崩溃报告中,并允许您正确读取它。

Ideally, your dSYM file shouldn't be tracked in your git repo. 理想情况下,不应在git仓库中跟踪您的dSYM文件。 Like other binaries that change on building, it's not useful to keep them in source control. 像在建筑物上改变的其他二进制文件一样,将它们保存在源代码管理中是没有用的。 However, having that said, it is important that you keep the dSYM files for each distributed build (betas, press releases, app store distributions, etc.) somewhere safe so that you are able to symbolicate any crash reports you might get. 但是,说到这一点,重要的是保持每个分布式构建(测试版,新闻稿,应用程序商店发行版等)的dSYM文件安全,以便您能够表示您可能获得的任何崩溃报告。 Xcode does this automatically for you when you use the Archive option. 当您使用存档选项时,Xcode会自动为您执行此操作。 The created archive contains your app and its dSYM and is stored within Xcode's derived data directory. 创建的存档包含您的应用程序及其dSYM,并存储在Xcode的派生数据目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM