I have an XCode MacOS application project in Swift. I need to send a signal to another process. Calling of the kill(pid_t, Int32)
function doesn't work. My process-receiver doesn't receive any signal. Also, I tried to call bash code from swift using Process
:
let task = Process()
task.launchPath = "/usr/bin/env"
task.arguments = ["kill", "-s", "SIGUSR1", receiverID]
task.launch()
task.waitUntilExit()
return task.terminationStatus
But I got an error in console kill: 6340: Operation not permitted
.
Could you help me? How can I send a signal to another process?