While debugging on XCode, I wanted to find out how to get the PID of the currently debugged application, from this sample;
2012-07-02 16:02:02.124 appname[14995:700]
which one of those is the pid? i need to get the pid because i wanted to check a memory leak using malloc_history which requires the pid of the application,
i tried the ff: combinations,
shell malloc_history
app
appname.app
appname[14995]
appname[14995:700]
14995
14995:700
700
0x000000 (address)
but I always get the process does not exist in the history tbe (malloc_history cannot find a process you have access to which has a name like "")
If you're using Cocoa you can use:
[NSProcessInfo processInfo].processIdentifier;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With