3

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?

Asad R.
  • 1,051
  • 13
  • 20
  • 2
    I am having this same problem. A few notes: I have used Shark successfully before, although this is my first try since iOS4. iPod-Touch device running 4.0.2. XCode 3.2.3. Shark 4.7.3. Firewall off (and Shark allowed, even when it's on.) Press START button and no response. No pop, no recording, no nothing. – Olie Sep 01 '10 at 16:18

3 Answers3

1

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
  • 563
  • 4
  • 6
0

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
  • 331
  • 1
  • 3
  • 5
0

I found Shark disabled as well after upgrading Xcode. I accidentally discovered the problem when installing Xcode on another machine that had not previously had Xcode installed.

Because I am really paranoid and like to keep my avenues for retreating open I don't install Xcode in /Developer. Instead I install it in something like /Developer-3.2.5 then I create a symbolic link to from /Developer to /Developer-3.2.5. Then, if there is a problem I just switch my symbolic link back to the old version.

The problem arrises, however, because of what appears to be an installer error. Even though I said to install in /Developer-3.2.5 it still installed a hand full of stuff in /Developer (including Shark).

Since I had a symbolic link to the old SDK it just wrote the Shark and others into the old version and not in the new version. Then when I re-made my symbolic link they were just not there. On the fresh-install machine when I went to make the symbolic link there was already a /Developer directory that should not have been there.

To get around this I have to remove my symbolic link before installing, do the install into /Developer-3.2.5, move the wandering files over into /Developer-3.2.5, remove /Developer, then create my symbolic link.

This may have nothing to do with your Shark running problems but it was what created my problems.

Good luck...

LavaSlider
  • 2,494
  • 18
  • 29