-1

I set it to iPhone/Network mode, but the device never appears anywhere. Connected and running an app through xcode. Do you know a useful tutorial for this?

1 Answers1

6

This answer provides a step-by-step guide to connecting Shark to a running instance of your application on an iPhone.

As far as tutorials on how to use Shark, there are the following:

Among the most powerful things you can do with Shark is to do a time profile of your application, then right-click on the low-level symbols (objc_msgSend, etc.) and charge the symbol or library to its caller. This very quickly lets you determine what methods of yours are chewing up the most CPU time.

When dealing with multithreaded applications, I find it useful to do a system trace and then examine the timeline to see when various threads were executing. You may wish to show the advanced controls (Window | Show Advanced Settings) to enable more visualization options. One the Mac, it can be useful to turn on CPU coloring, but that's of little use on the current iPhones.

Personally, I would suggest picking up the WWDC videos from year 2009's conference. If you only take the iPhone track, they are a great deal at $299. There are a couple of sessions that show how to use Shark and Instruments to tune iPhone applications. Additionally, if you pay for the ADC Select membership, you'll have access to several videos on using Shark from previous WWDC conferences. I learned most of what I know about Shark from these videos.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • Thanks for the links! I'm sure the WWDC videos and ADC membership is really useful, but I'm not rich enough to spend so much for this. Don't even have an iPhone ;-) –  Oct 24 '09 at 10:19
  • I don't know if Shark still exists, but I can't find any WWDC video of it anymore on Apple website. – Cœur Jun 02 '19 at 16:36
  • 1
    @Cœur - Now that's a name I haven't heard in years. Time Profiler caused it to ride off into the sunset, so little of this will be relevant today. I flagged to have another moderator review this, since my answer here causes a slight conflict on me closing this unilaterally. – Brad Larson Jun 03 '19 at 14:50
  • @Cœur I've closed the question, but I'm going to leave this answer up for the time being - unless you think the whole thing should be deleted. – ChrisF Jun 03 '19 at 14:58
  • @ChrisF I'm not a deletionist: closing is enough. – Cœur Jun 03 '19 at 15:00