Chapter 16: Testing Code with Instruments

In This Chapter

Beginning with Instruments Exploring the Instruments UI Using instrument templates Profiling a live application Comparing runs Creating custom templates and instruments

Debugging is ideal for low-level line-by-line fault finding. But it's often useful to take a wider view of application performance—for example, to identify performance bottlenecks, monitor processor loading, and check for memory leaks.

The Xcode toolchain includes a powerful and comprehensive helper application called Instruments, used for general testing and profiling. Instruments is a general purpose time line–based test rig that supports a selection of instruments—plug-in test probes that monitor some feature or performance metric.

mac_note.eps NOTE

The name of the test application is Instruments, with a capital I. The individual test plug-ins are instruments, with a small i.

You can combine multiple instruments to create a custom test rig, save the rig for use with other applications, and save the results of every test run for comparison with other runs. Instruments supports both iOS and OS X applications, but each OS supports a slightly different selection of instruments.

These are the key benefits of Instruments:

bl.eps A time line: You can graph and compare the output ...

Get Xcode® 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.