How to run iPhone program with Zombies instrument?

前端 未结 3 2077
无人共我
无人共我 2020-12-04 10:21

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 N

相关标签:
3条回答
  • 2020-12-04 10:27

    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:

    • 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.
    0 讨论(0)
  • 2020-12-04 10:28

    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

    0 讨论(0)
  • 2020-12-04 10:45

    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.

    0 讨论(0)
提交回复
热议问题