Where is the instruments command line tool?

I was reading through this documentation about instruments command line tool https://help.apple.com/instruments/mac/current/#/devb14ffaa5 and how it can be launched from the command line. However, unlike what the documentation states, there's no such instruments command anywhere on my macos M1 (OS version 15.6). That command gives:

$> instruments
zsh: command not found: instruments

I do have XCode installed which has the Instruments.App (GUI app) but not the command line utility:

$> ls Xcode.app/Contents/Applications/
...  Instruments.app

Is that linked documentation up-to-date (it does say "latest" in the URL)? Is there some other way to install this command line utility?

Answered by Developer Tools Engineer in 856010022

Hi! The instruments command-line tool was deprecated a few years ago and replaced with xctrace. The help page you linked is indeed out of date and unfortunately there isn’t anny official online documentation for xctrace that I could find. That said, you can run xctrace --help or xctrace <subcommand> --help to access the built-in help which documents all the options and includes a number of usage examples.

Jed

Accepted Answer

Hi! The instruments command-line tool was deprecated a few years ago and replaced with xctrace. The help page you linked is indeed out of date and unfortunately there isn’t anny official online documentation for xctrace that I could find. That said, you can run xctrace --help or xctrace <subcommand> --help to access the built-in help which documents all the options and includes a number of usage examples.

Jed

The instruments command-line tool was deprecated a few years ago and replaced with xctrace.

Thank you Jed, I'll read up on xctrace and give it a try.

Hello Jed, I gave xctrace a try on my macos M1 system. But every time I use "xctrace record ...", it generates a kernel panic and reboots the system. I have filed a feedback issue FB20000672 with the details.

Where is the instruments command line tool?
 
 
Q