鲨鱼与 适用于 iPhone 应用程序的 MallocDebug

发布于 2024-08-02 02:01:44 字数 496 浏览 6 评论 0原文

我正在尝试优化我正在开发的使用 Cocos2D-iphone 框架的 iPhone 游戏。

我想使用 Shark 来测量性能,但 XCode 中禁用了“运行 -> 使用性能工具启动 -> Shark”(Instruments Leaks 工作正常)。 我已将构建配置为“生成分析代码”,尝试为设备和模拟器构建,但没有运气,Shark 仍然处于禁用状态。

我还尝试手动启动 Shark(在 XCode 之外),但同样无效。 在“采样 -> 网络/iPhone 采样”下,我选择了“控制共享计算机的网络分析”单选按钮,并勾选了列出的设备旁边的复选框。 当我按下开始键时,什么也没发生。

Shark 非常适合桌面应用程序。 我正在使用 Shark 4.7.0 (244.4) 和 XCode 3.1.3。 我正在 SDK 版本 2.2.1 上构建 iphone 应用程序。

我需要在 iPhone 上安装某个应用程序才能让 Shark 工作吗?还是我还缺少其他东西?

I'm trying to optimize an iPhone game that I am developing which uses the Cocos2D-iphone framework.

I want to use Shark to measure performance but "Run->Start with Performance Tool->Shark" is disabled in XCode (Instruments Leaks works fine). I've configured the build to "Generate Profiling Code", tried building for both the device and the simulator but with no luck, shark still stays disabled.

I also tried to launch Shark manually (outside of XCode), and it was equally ineffective. Under "Sampling->Network/iPhone sampling", I chose the "Control network profiling of shared computers" radiobutton and tick the checkbox next to my listed device. When I pressed Start, nothing happened.

Shark works fine for desktop apps. I'm using Shark 4.7.0 (244.4), and XCode 3.1.3. I'm building the iphone app on SDK ver 2.2.1.

Is there an app I need to install on the iPhone to get Shark to work, or is there something else I'm missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我一直都在从未离去 2024-08-09 02:01:44

今晚刚刚第一次尝试鲨鱼。 以下内容适用于我,在 Xcode 3.2 和 Shark 4.7.1 中。 我为我的发布版本构建了调试符号,但没有选择“生成分析代码”。

  1. 构建应用程序并在设备上
  2. 启动 启动 Shark
  3. 从 Shark 菜单中,选择采样 -> 网络/iPhone 分析
  4. 在 Shark 窗口中,选择单选按钮“控制共享计算机的网络分析”。
  5. 在列表中选择您的 iPhone,然后选择配置分析会话
  6. 按“开始”开始分析,然后按“停止”结束

希望这会有所帮助!

Just tried Shark for the first time tonight. The following works for me, in Xcode 3.2 and Shark 4.7.1. I have debug symbols built for my release build, but I don't have "Generate Profiling Code" selected.

  1. Build app and launch on device
  2. Launch Shark
  3. From the Shark menu, select Sampling->Network/iPhone Profiling
  4. In the Shark window, select the radio button "Control network profiling of shared computers".
  5. Select your iPhone in the list and optionally configure the profiling session
  6. Press Start to begin profiling, and Stop to end

Hope this helps!

坦然微笑 2024-08-09 02:01:44

两件事:

  1. 作为单独的应用程序运行 shark(在聚光灯下查找它)

  2. 如果您有防火墙,则必须允许 shark接受传入连接,否则它将无法与您的 iPhone 配合使用。

一旦 shark 运行,它应该在 Xcode 中显示为已启用。

我希望这有帮助。

Two things:

  1. Run shark as a separate application (look for it in spotlight)

  2. If you have a firewall then you must allow shark to accept incoming connections or it won't be able to work with your iPhone.

Once shark is running it should appear enabled in Xcode.

I hope this helps.

柳若烟 2024-08-09 02:01:44

我发现升级 Xcode 后 Shark 也被禁用了。 我在另一台之前没有安装过 Xcode 的机器上安装 Xcode 时意外发现了这个问题。

因为我真的很偏执,并且喜欢保持我的退路畅通,所以我不会在 /Developer 中安装 Xcode。 相反,我将其安装在 /Developer-3.2.5 之类的位置,然后创建一个从 /Developer 到 /Developer-3.2.5 的符号链接。 然后,如果出现问题,我只需将符号链接切换回旧版本即可。

然而,由于安装程序错误,出现了问题。 尽管我说要安装在 /Developer-3.2.5 中,但它仍然在 /Developer 中安装了很多东西(包括 Shark)。

由于我有一个到旧 SDK 的符号链接,它只是将 Shark 和其他内容写入旧版本而不是新版本中。 然后,当我重新创建符号链接时,它们就不存在了。 在新安装的计算机上,当我去创建符号链接时,已经有一个不应该存在的 /Developer 目录。

为了解决这个问题,我必须在安装之前删除我的符号链接,将其安装到 /Developer-3.2.5 中,将漫游文件移到 /Developer-3.2.5 中,删除 /Developer,然后创建我的符号链接。

这可能与您的 Shark 运行问题无关,但它却造成了我的问题。

祝你好运...

I found Shark disabled as well after upgrading Xcode. I accidentally discovered the problem when installing Xcode on another machine that had not previously had Xcode installed.

Because I am really paranoid and like to keep my avenues for retreating open I don't install Xcode in /Developer. Instead I install it in something like /Developer-3.2.5 then I create a symbolic link to from /Developer to /Developer-3.2.5. Then, if there is a problem I just switch my symbolic link back to the old version.

The problem arrises, however, because of what appears to be an installer error. Even though I said to install in /Developer-3.2.5 it still installed a hand full of stuff in /Developer (including Shark).

Since I had a symbolic link to the old SDK it just wrote the Shark and others into the old version and not in the new version. Then when I re-made my symbolic link they were just not there. On the fresh-install machine when I went to make the symbolic link there was already a /Developer directory that should not have been there.

To get around this I have to remove my symbolic link before installing, do the install into /Developer-3.2.5, move the wandering files over into /Developer-3.2.5, remove /Developer, then create my symbolic link.

This may have nothing to do with your Shark running problems but it was what created my problems.

Good luck...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文