The Xcode instruments allow you to dynamically trace and profile the performance of your Mac OS X, iPhone, and iPad applications. You can also create your own Instruments using DTrace and the Instruments custom builder.
Note
We do not cover DTrace in this book, if you are interested in reading a bit more about this area; please consult the Apple Developer Documentation at the following: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/dtrace.1.html#//apple_ref/doc/man/1/dtrace. DTrace has not been ported to iOS, so it is not possible to create a custom instrument for devices running iOS.
Through the use of instruments, you can achieve the following:
Ability to perform stress-tests on your applications
Monitor your applications for memory leaks, which can cause unexpected results
Gain a deeper understanding of the execution behaviour of your applications
Track down difficult-to-reproduce problems in your applications
In the screenshot displayed below, it shows you the current list of available instrument templates which you can choose from, to perform a variety of different traces on your iOS applications. We will be discussing and using these in greater detail, when we come to Chapter 10, Making your Applications run smoothly.
In the following screenshot, we display the Instruments environment where you can start to create your robust test harness for your application to ensure that any memory leaks and resource-intensive tasks are rectified to avoid problems later when your users download your app and experience issues:
Note
If you are interested in learning more about the other applications that are included with Xcode and the iOS 4 SDK, please consult the Apple Developer documentation at the following: http://developer.apple.com/