4 ms·
Speaking of the GUI Instruments.app. Is there a way to start a process from there, instead of attaching to an already running process? I used it the other day a
by codetrotter 6y ago
Speaking of the GUI Instruments.app. Is there a way to start a process from there, instead of attaching to an already running process? I used it the other day and could only figure out how to attach to an already running process with it.
- arcticbull 6y agoCreate a new profiling environment based on the template you're interested in, making sure "Choose a profiling template for:" is set to "Your Computer > All Processes." Next, in the top-left of the window, where it says "Your Computer > All Processes", click on All Processes. Select Choose Target... and navigate to your binary and hit Choose. Then hit the red circle to begin recording. This will launch a new instance of the specified binary and profile it. This may not work for binaries that set PT_DENY_ATTACH, though.
- codetrotter 6y agoThanks :)
- comex 6y agoYes, it’s possible. In the menu with all the processes, pick the option “Choose Target”. It’s kind of an annoying UI, but it works. Another option is to use `xcrun xctrace` to get a recording from the command line, which can then be opened in Instruments.