cmyr / cargo-instruments

A cargo plugin to generate Xcode Instruments trace files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xcrun: error: unable to find utility "xctrace"

cdstanford opened this issue · comments

Thank you for providing this tool! I'm getting the following error:

    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
   Profiling target/debug/run_example with template 'Allocations'
      Failed instruments errored: xcrun: error: unable to find utility "xctrace", not a developer tool or in PATH

I installed through brew install cargo-instruments. Then I tried running the following command:

cargo instruments -t Allocations --bin <bin name>

Does anything here solve this for you? #42

I saw that thread before, but it doesn't seem to be the solution. People were pointing to some things in XCode settings, but either something is wrong with my installation of xcode or it isn't shipped in mac as a separate program anymore. I've noticed that xcode-select -p suggests it's installed:
/Library/Developer/CommandLineTools
but that there's no XCode program listed in Applications or system preferences

At any rate, I didn't end up getting a Rust profiler to work and I'm not sure I will have time to investigate this further on my setup, so I'll close this issue unless you want to look into it further. Thanks for responding!

Ah yea you need to install Xcode to get the instruments app, I think the standard route is now via the Mac App Store.

I have the same issue. Also installed via Homebrew, and I have the devtools installed.

MacOS Ventura 13.0, ARM-Based Mac M2.

# Checking Instruments app
❯ open /Applications/Xcode.app/Contents/Applications/Instruments.app
(this command correctly opens the Instruments app)

# Checking developer tools 
❯ xcode-select -p
/Library/Developer/CommandLineTools
❯ which xcrun
/usr/bin/xcrun
❯ which xctrace
/usr/bin/xctrace

# Trying to run it like in the README
❯ cargo instruments -t Allocations
   Finished dev [unoptimized + debuginfo] target(s) in 0.10s
   Profiling target/debug/myapp with template 'Allocations'
     Failed instruments errored: xcrun: error: unable to find utility "xctrace", not a developer tool or in PATH

I had xcode-beta installed - apparently that also doesn't work. Need to install xcode itself, not the beta.

Good way to install is using xcodes

I was able to get this working by installing xcode and then running:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer