run(_:arguments:terminationHandler:)
Creates and runs a task with a specified executable and arguments.
Declaration
class func run(_ url: URL, arguments: [String], terminationHandler: (@Sendable (Process) -> Void)? = nil) throws -> ProcessParameters
- url:
The URL for the executable.
- arguments:
An array of
NSStringobjects that supplies the arguments to the task. Ifargumentsisnil, the system raises anNSInvalidArgumentException. - terminationHandler:
The system invokes this completion block when the task has completed.
Return Value
An initialized NSTask object with the environment of the current process.