Is there a Quick Guide on how to use Shark with iPhone to measure performance? [closed]

China☆狼群 提交于 2019-12-30 07:48:31

问题


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:


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:

  • "Optimizing Your Application with Shark 4"
  • "Optimizing with Shark: Big Payoff, Small Effort"
  • "Optimizing Your Application with System Trace in Shark 4"
  • "Using Shark and custom DTrace probes to debug Nagios on Mac OS X"

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.



来源:https://stackoverflow.com/questions/1616548/is-there-a-quick-guide-on-how-to-use-shark-with-iphone-to-measure-performance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!