I'm trying to run terminal command pluginkit -m
in my mac app but it returns message match: unauthorized discovery flag (PKDiscoverAll)
.But if I run ls
command it works fine.
Can someone please explain how can I run pluginkit -m
command or point me to documentation where apple explains why these command can't be run from an app. These commands run fine on my terminal.
Here is my code
let task = Process()
let pipe = Pipe()
task.standardOutput = pipe
task.standardError = pipe
task.arguments = ["-c", "pluginkit -m"]
task.executableURL = URL(fileURLWithPath: "/bin/zsh") //<--updated
task.standardInput = nil
try task.run()
let data = pipe.fileHandleForReading.readDataToEndOfFile()
let output = String(data: data, encoding: .utf8)!