Create, Save, and Open Trace Documents
In Instruments, all work is done in a trace document, which contains a set of instruments, their configured settings, and the data they have collected. Once you profile an app with a trace document, you can save the document to preserve the trace data you have gathered and open it again later for viewing and analysis.
About Profiling Templates
When Instruments first starts up, it provides a list of profiling templates (see). Each template contains a collection of instruments that are commonly used together to analyze an app and gather useful information in order to help identify problems or make your app more efficient.
You should plan to use a profiling template as a starting point whenever you need to collect data for a particular purpose. For example, if you want to check your app for memory problems, you should choose a memory-related template, such as Allocations, Leaks, or Zombies. After using a template to create a trace document, you can always add or remove individual instruments, or reconfigure instruments, as needed.
For a complete list of available templates and the instruments they contain, see Profiling Templates.
Create a Trace Document
You need to create a trace document to begin profiling with Instruments.
In the profiling template selection dialog that appears, select a target device and process.
Select the desired profiling template.
Save a Trace Document
Once you’ve created a trace document, you can save it for later reference. Instruments saves trace documents as Instruments trace files with the
Create a trace document. See To create a trace document.
Choose File > Save. Or, choose File > Save As if you want to save a previously saved trace document as a new file.
Enter a name for the file.
Choose a destination for the file.
Save a Trace Document as a Profiling Template
If you create a trace document you think you might need again for profiling other apps, you can save it as a custom template so you don’t have to recreate it each time you run Instruments.
Create or open a trace document. See To create a trace document.
Choose File > Save As Template.
Enter a name for the template.
Choose a destination for the template.
Save your template in the
/Library/Application Support/Instruments/Templatesdirectory to make it available in the custom section of the Instruments template window. This is the default directory in the Save As Template dialog.
Select an icon for the template.
Enter a description for the template.
Once you save a template, it automatically appears in the profiling template selection dialog, grouped with the Custom templates. Next time you create a trace document, you can select it as your starting point.
Close a Trace Document
Choose File > Close (or press Command-W).
If your document contains unsaved data, select whether to save the updated document.
The document closes.
Open a Trace Document
Do one of the following:
.tracedocument file in the Finder.
.tracedocument file onto the Instruments app icon.
Open Instruments and perform the following steps:
Choose File > Open (or press Command-O).
Locate a saved
The trace document opens in Instruments.