如何使用Zombies工具运行iPhone程序?
我正在 Snow Leopard 上运行 XCode 3.2,并且尝试针对我的应用程序运行 Zombies 工具,但选择是灰色的,我不知道为什么。我知道 NSZombieEnabled 环境变量。我在我的申请中将其设置为“是”。我不确定这是否重要,但是,该应用程序是我使用以前版本的 XCode 在 Leopard 上开始开发的应用程序。这是我的菜单的屏幕截图:
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:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要从 Xcode 外部使用 Zombies 工具启动 Instruments 应用程序
具体方法如下:
Instruments 应用程序通常位于
/Developer/Applications/
内,但您也可以使用 Spotlight 来查找它。当 Instruments 启动时,您应该会看到一个屏幕,要求您为新的跟踪文档选择一个模板。
选择:
iPhone模拟器>内存>僵尸
接下来你需要选择一个目标。
转到:
选择目标>选择目标>选择目标...
现在您需要选择应用程序文件:
/build/Debug-iphonesimulator/<应用程序名称>
然后按
选择
。现在一切都准备好了。
要启动应用程序,请按
Record
按钮。一些附注:
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 press
Chose
.Now you are all set.
To launch you application press the
Record
button.A few Side Notes:
您确定将其设置在正确的位置吗?我的意思是,它是运行时可调的,而不是编译时的。请确保您将其设置在正确的位置,然后重试。
转到项目 ->编辑活动的可执行文件
单击参数
单击“要在环境中设置的变量”部分中的 +
在“名称”列中输入 NSZombieEnabled,在“值”列中输入 YES。
确保选中 NSZombieEnabled 条目的复选标记。
Are you sure you're setting it in the right place? I mean, it is a runtime tuneable, not compile time. Just be sure you're setting it in the right place and try again.
Go to Project -> Edit Active Executable
Click Arguments
Click + in the "Variables to be set in the environment" section
Enter NSZombieEnabled in the Name column and YES in the Value column.
Make sure the checkmark for the NSZombieEnabled entry is checked.
正如Apple工程师所说,Run with Performance Tool下的大多数项目都需要dTrace支持,但dTrace还不适用于iOS,甚至不适用于模拟器。
然而,奇怪的是,您可以在 Instruments 中手动设置模板来测试僵尸,如@florin所述
As said by Apple engineers, most items under Run with Performance Tool need dTrace support, but dTrace is not available for iOS yet, not even for simulators.
However, strangely, you can manually set up a template in Instruments to test zombies, as described by @florin