I have a swift 5.4 package manager project with an executable target I want to profile in Instruments.
I Cmd+I to profile which launches instruments. I pick allocations.
then push the record button.
im asked to authorise and doesn’t matter whether I use fingerprint or password I always get the error:
(before run started) Failed to gain authorization
any ideas?
instruments 12.5 xcode 11.5 swift 5.4 2020 M1 MBP 13”
Note I get the same if I try to profile any arbitrary running process.
I'm getting the same error for a C++ code that I compile with the system's clang. If instruments cannot profile code that I compile myself on my system it becomes entirely useless. In this case I really should not have to worry about code signing as is suggested below.
I have the same problem with versions of Xcode 12.5.1 to 14.0. At least Xcode 125.1 puts out a useful error. Xcode 13 and newer puts out the very unhelpful error message "Required kernel recording resources are in use by another document.". I was able to get around the issue by editing my target's scheme and temporarily changing the Profile > Build Configuration from Release to Debug.