Instruments的使用

本文解答了如何在XCode中使用Zombies工具诊断内存问题。文章详细介绍了启动Instruments应用并选择Zombies模板的方法,以及如何指定目标应用程序进行调试。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转自:http://stackoverflow.com/questions/1417782/how-to-run-iphone-program-with-zombies-instrument


问:

I'm running XCode 3.2 on Snow Leopard and I'm trying to run the Zombies instrument against my app but the selection is grayed out and I don't know why. I know about the NSZombieEnabled environment variable. I have that set to YES on my application. I'm not sure if this matters, but, the app is an app that I started developing on Leopard with the previous version of XCode. Here is a screenshot of what my menu looks like:

答:

You need to launch the Instruments application with the Zombies instrument from outside of XCode

This is how you can do it:

The Instruments application is usually located inside/Developer/Applications/, but you can also use Spotlight to find it.

When Instruments starts you should be presented with a screen that asks you to choose a template for the new Trace Document.

Select:iPhone Simulator > Memory > Zombies

Next you need to choose a target.

Go to:Chose target > Chose target > Chose target...

Now you need to select the application file:
<Path to your iPhone project>/build/Debug-iphonesimulator/<Application name>
and pressChose.

Now you are all set.

To launch you application press theRecordbutton.

A fewSide Notes:

  • I used XCode 3.2.3 on Mac OS X 10.6.3, but I believe it works the same on previous versions.
  • The Zombies instrument only works with the simulator.
  • The Zombies instrument cannot be used with the Leaks instrument because all the zombies would appear as leaks.
  • I would also like to know why the menu in XCode is grayed out.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值