Export and Import Trace Data
Instruments offers a variety of ways to export and import data for consolidation, archival purposes, analysis within Instruments, and external analysis through other tools.
Export Trace Data
You can export data from a trace document to a comma-separated value (CSV) file format, a simple data file format supported by many apps, including most database and spreadsheet apps. By bringing data into another app, such as Numbers, you can manipulate it further, perform additional analysis, generate custom charts and graphs, compare it to other data, and more.
After profiling an app with a trace document, select the instrument containing the data you want to export.
Choose Instrument > Export Track for instrumentname.
Enter a name for the file.
Specify a destination for the file.
Instruments exports the data for the most recent run of the selected instrument.
Import Data from a Device
Import Data from the (sample) Command-Line Tool
If you use the
sample command-line tool to do a statistical analysis of your app’s execution, you can import your sample data and view it in Instruments. Importing data from the
sample tool creates a new trace document with the Sampler instrument and loads the sample data into the detail pane. Because the samples do not contain time stamp information, you can only view the data using outline mode in the detail pane. A new trace document is created based on the file you select.
Launch the Terminal app.
samplecommand, such as:
sample ListerOSX -file ~/Desktop/SampleData.txt
This example samples an app for 10 seconds (the default), and saves the results to a file on the desktop.
Choose File > Import Data.
Locate your saved data.
Choose Sampler from the “Choose Instrument to Import Data” pop-up menu at the bottom of the Import Trace window. If this pop-up menu isn’t visible, click the Options button to display it.
A new trace document containing the Sampler instrument is created, and it’s populated with the data you imported.