尽管所有构建设置相反,Xcode Instruments仍在剥离符号 [英] Xcode Instruments is stripping symbols despite all build settings to the contrary

查看:124
本文介绍了尽管所有构建设置相反,Xcode Instruments仍在剥离符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题

Instruments的Time Profiler正在从我的应用程序中删除除系统库之外的所有符号,尽管事实上我已在Xcode的所有相关构建设置中禁用了此行为-但仅在一台开发机上.其他开发机器的行为正常.

Instruments' Time Profiler is stripping all symbols except system libraries from my app, despite the fact that I have disabled this behavior in all relevant build settings in Xcode — but only on one development machine. The other dev machine behaves normally.

说明

Instruments的Time Profiler正在剥离除系统库之外的所有符号,尽管事实上我已在Xcode的所有相关构建设置中禁用了此行为-但这仅发生在我的一台开发机上.我有两台运行相同版本的OS X,Xcode和Instruments的开发机器,每台机器都使用相同的Xcode项目的相同副本,并具有相同的构建设置,方案和其他配置,并且使用相同的配置文件对应用程序进行了配置测试设备(具有iOS 5的最新公共版本的iPhone 4S).

Instruments' Time Profiler is stripping all symbols except system libraries, despite the fact that I have disabled this behavior in all relevant build settings in Xcode — but this is only happening on one of my development machines. I have two development machines running the same version of OS X, Xcode, and Instruments, and each machine is using an identical copy of the same Xcode project with identical build settings, schemes, and other configurations, and the app is profiled using the same test device (iPhone 4S with the latest public version of iOS 5).

机器1
-Mac OS X 10.7.4
-Xcode 4.3.2(4E2002)
-仪器4.3(4321)

Machine 1
- Mac OS X 10.7.4
- Xcode 4.3.2 (4E2002)
- Instruments 4.3 (4321)

机器2
-Mac OS X 10.7.4
-Xcode 4.3.2(4E2002)
-仪器4.3(4321)

Machine 2
- Mac OS X 10.7.4
- Xcode 4.3.2 (4E2002)
- Instruments 4.3 (4321)

复制步骤

  1. 在每台计算机上打开包含的示例项目.
  2. 确保选择iPhone 4S作为测试设备.
  3. 选择产品>配置文件
  4. 启动仪器时,选择"Time Profiler"并继续.
  5. 运行该应用程序.
  6. 请注意在iMac(机器1)上而不是MacBook Air(机器2)上运行时如何去除符号.

预期行为

我自己的代码中的符号应出现在两台计算机上的Time Profiler中.

Symbols from my own code should appear in the Time Profiler on both machines.

回归

我尝试了以下所有操作,但实际结果没有变化:

I have tried all of the following, with no change in the actual results:

  1. 重新启动计算机.

  1. Rebooting the machine.

尝试其他Xcode项目

Trying other Xcode projects

为Xcode Organizer中的所有项目删除派生数据".

Deleting the "Derived Data" for all projects in the Xcode Organizer.

在Instruments中重新符号化文档(在〜/Library/blahBlahBlah…中仔细选择正确的DSYM文件)

Re-symbolicating the document in Instruments (carefully selecting the correct DSYM file in ~/Library/blahBlahBlah…)

最终提示

以下是示例项目的.zip文件的链接:示例项目.zip

Here is a link to a .zip file of a sample project: Sample Project .zip

推荐答案

我终于能够通过一种不占空间的方法使它起作用:

I was finally able to get it to work by a method that's just shy of a nuke-and-pave scenario:

  1. 请绝对确保您当前的构建配置已禁用所有符号剥离.如果这是针对Instruments进行配置的版本,请确保已针对发布"配置完成此操作.
  2. 从iOS设备上删除该应用.
  3. 重新启动iOS设备.
  4. 重新启动Mac(我完全不信任Xcode或Lion 否则退出所有相关进程).
  5. 启动Xcode,转到组织者">项目",然后删除受影响项目的派生数据".
  6. 清理您的项目.地狱,为什么不呢?
  7. 构建和配置乐器.
  8. 为清楚起见,在乐器"中选择时间分析器".
  9. 第一次运行将显示符号,但不退出.保持仪器运行!
  10. 重新符号化Instruments中的文档,仔细浏览至当前版本的正确dSYM文件.由于您已在步骤5中删除了派生数据,因此应该更容易.
  11. 现在您应该可以看到您的符号了.如果您隐藏非目标C符号,则将很有帮助.
  1. Make absolutely sure all symbol stripping is disabled for your current build configuration. Make sure you've done this for your Release config if that's what's being profiled for Instruments.
  2. Delete the app from the iOS device.
  3. Restart the iOS device.
  4. Restart the Mac (I don't trust Xcode or Lion at all to quit all relevant processes otherwise).
  5. Launch Xcode, go to Organizer > Projects and delete Derived Data for the affected project.
  6. Clean your project. Hell, why not?
  7. Build and profile for Instruments.
  8. Choose the Time Profiler in Instruments for clarity.
  9. The first run will not show the symbols, but don't quit. Leave Instruments running!
  10. Re-symbolicate the document in Instruments, navigating carefully to the correct dSYM file for the current build. This should be easier since you've deleted the derived data in step 5.
  11. Now you should be able to see your symbols. It helps if you hide non-objective-C symbols.

为什么我建议您在步骤2和3中删除应用程序并重新启动iOS设备?我怀疑Xcode不会对每个内部版本进行全新安装,但可能会安装增量版本,因此Instruments中存在的符号地址是当前内部版本与以前的内部版本的混合.如果是这样,那么对于像我这样的人来说,这个问题就更常见了,他们在多个Mac之间共享一个测试设备.这个假设可能是完全错误的.

Why do I suggest that you delete the app and restart the iOS device in Steps 2 and 3? I have a suspicion that Xcode doesn't perform a clean installation of each build, but may install deltas, such that the symbol addresses present in Instruments are a mixture of the current build plus previous builds. If so, then this issue is even more common for someone like me, who shares a single test device between more than one Mac. This assumption could be wildly incorrect.

如果上述步骤不适合您,请在评论中让我知道.我想在将来的某个时候创建​​一份详细的雷达报告.

If the above steps don't work for you, please let me know in the comments. I'd like to create a detailed radar report at some point in the future.

这篇关于尽管所有构建设置相反,Xcode Instruments仍在剥离符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆