O'Reilly logo

Xcode® 4 by Richard Wentk

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required