views:

1507

answers:

2

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?

+1  A: 

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!

brian sharon
A: 

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.

David Faitelson