Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

ScreenShot

like image 847
Justin Kredible Avatar asked Sep 13 '09 13:09

Justin Kredible


People also ask

How do I run an instrument in Xcode?

Press Command-I in Xcode, select Allocations from the list and press Choose. After a moment, you'll see the Allocations instrument. It should look familiar because it looks a lot like Time Profiler. Click the record button in the top-left corner to run the app.

What is Zombie object in IOS?

Once an Objective-C or Swift object no longer has any strong references to it, the object is deallocated. Attempting to further send messages to the object as if it were still a valid object is a “use after free” issue, with the deallocated object still receiving messages called a zombie object.

What is profiler in Swift?

In simplest of terms, Time Profiler collects information about your app while it's running, determines how long each of your functions takes to run, and also figures out the percentage of CPU cycles each of your functions is using.


1 Answers

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.
like image 115
Florin Avatar answered Sep 23 '22 13:09

Florin