ios .dSYM 文件是如何创建的?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22460058/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How is a .dSYM file created?
提问by couchy
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. Will any changes I make to the XCode project file change the dSYM? If I was able to make a build without modifying the XCode project file, would the dSYM file be the same?
我正在与另一位开发人员合作开发一个应用程序,他们刚刚向在他们的计算机上构建的应用程序商店提交了一个版本。为了在我的机器上进行构建(属于同一个 git commit),我必须更改我们在 XCode 项目中使用的库之一的路径。我对 XCode 项目文件所做的任何更改是否会更改 dSYM?如果我能够在不修改 XCode 项目文件的情况下进行构建,那么 dSYM 文件是否相同?
回答by Jasarien
A dSYM file is a "debug symbols file". It is generated when the "Strip Debug Symbols" setting is enabled in the build settings of your project.
dSYM 文件是“调试符号文件”。它是在项目的构建设置中启用“条带调试符号”设置时生成的。
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. Xcode uses the dSYM to put the symbols back into the crash report and allow you to read it properly.
它们对于重新符号化您的崩溃报告很有用。使用剥离的二进制文件,如果不首先重新符号化它们,您将无法读取任何崩溃报告。如果没有 dSYM,崩溃报告将只显示对象和方法的内存地址。Xcode 使用 dSYM 将符号放回崩溃报告中,并允许您正确阅读。
Ideally, your dSYM file shouldn't be tracked in your git repo. 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. Xcode does this automatically for you when you use the Archive option. The created archive contains your app and its dSYM and is stored within Xcode's derived data directory.
理想情况下,您的 dSYM 文件不应在您的 git 存储库中进行跟踪。与其他在构建时更改的二进制文件一样,将它们保留在源代码管理中是没有用的。但是,话虽如此,将每个分布式构建(测试版、新闻稿、应用商店发行版等)的 dSYM 文件保存在安全的地方很重要,这样您就可以象征性地表示您可能获得的任何崩溃报告。当您使用存档选项时,Xcode 会自动为您执行此操作。创建的存档包含您的应用程序及其 dSYM,并存储在 Xcode 的派生数据目录中。