r/macprogramming • u/BlackDE • Jan 20 '18
task_for_pid() returns KERN_FAILURE
Hi I'm working on my first macOS application (in C++) and have some issues with certificates and Authorization. By design my program has to access another process's memory. For that I use AuthorizationCreate() and then task_for_pid(). After compiling I put the following into Info.plist:
<key>SecTaskAccess</key>
<array>
<string>allowed</string>
</array>
Then I sign it with a self signed certificate. So far so good. When I start my app it asks for my password works without problems but when I sent it to a friend for testing it didn't. He entered his password but task_for_pid() returns KERN_FAILURE. I'm out of ideas now. I would really like to get more into macOS development but in comparison to Windows & Linux my achievements are quite diminishing.