title: Operation not permitted when executing 'killall' with Swift
body: <p>I'm trying to create a menu bar app to hide desktop icons and hopefully various other things mostly to learn more about Swift, and for some reason I can't get it to work. When I run this program and click on one of the menu items, nothing happens and I get this warning in the console:</p>
  
  <pre><code>killall: warning: kill -TERM 15175: Operation not permitted
  </code></pre>
  
  <p>Other commands work, but any variant I try on "killall" spits out something like the above.  Currently my code looks like this:</p>
  
  <pre><code>@discardableResult
  func killStuff(_ args: String...) -&gt; Int32 {
      let task = Process()
      let pipe = Pipe()
  
      task.launchPath = "/usr/bin/killall"
      task.arguments = args
      task.standardOutput = pipe
      task.standardError = pipe
      task.launch()
      task.waitUntilExit()
  
      let data = pipe.fileHandleForReading.readDataToEndOfFile()
      if let output = String(data: data, encoding: .utf8) {
          print(output)
      }
  
      return task.terminationStatus
  }
  </code></pre>
  
  <p>I've tried numerous variations on the accepted solutions found <a href="https://stackoverflow.com/questions/26971240/how-do-i-run-an-terminal-command-in-a-swift-script-e-g-xcodebuild">here</a>, <a href="https://stackoverflow.com/questions/45701825/kill-process-in-swift">here</a>, and what I've found on Google, but I keep getting the same "Operation not permitted." When I run the same code in an Xcode playground, it works just fine.</p>
  
  <p>Thanks in advance!</p>