Instruments is a powerful and flexible performance-analysis and testing tool that’s part of the Xcode tool set. It’s designed to help you profile your macOS and iOS apps, processes, and devices in order to better understand and optimize their behavior and performance. Incorporating Instruments into your workflow from the beginning of the app development process can save you time later by helping you find issues early in the development cycle.
In Instruments, you use specialized tools, known as instruments, to trace different aspects of your apps, processes, and devices over time. Instruments collects data as it profiles, and presents the results to you in detail for analysis.
Unlike other performance and debugging tools, Instruments allows you to gather widely disparate types of data and view them side by side. This makes it easier to identify trends that might otherwise be overlooked. For example, your app may exhibit large memory growth caused by multiple open network connections. By using the Allocations and Connections instruments together, you can identify connections that are not closing and thus resulting in rapid memory growth.
By using Instruments effectively, you can:
Examine the behavior of one or more apps or processes
Examine device-specific features, such as Wi-Fi and Bluetooth
Perform profiling in a simulator or on a physical device
Create custom DTrace instruments to analyze aspects of system and app behavior
Track down problems in your source code
Conduct performance analysis on your app
Find memory problems in your app, such as leaks, abandoned memory, and zombies
Identify ways to optimize your app for greater power efficiency
Perform general system-level troubleshooting
Save instrument configurations as templates
Although it’s embedded within and may be used with Xcode, Instruments is a separate app, which may be used independently as needed.
For detailed information about Instruments, see Instruments Help.