<!--
{
  "availability" : [
    "macOS: 10.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Process/launchedProcess(launchPath:arguments:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTask(cm)launchedTaskWithLaunchPath:arguments:"
  },
  "title" : "launchedProcess(launchPath:arguments:)"
}
-->

# launchedProcess(launchPath:arguments:)

Creates and launches a task with a specified executable and arguments.

```
class func launchedProcess(launchPath path: String, arguments: [String]) -> Process
```

## Parameters

`path`

The path to the executable.

`arguments`

An array of `NSString` objects that supplies the arguments to the task. If `arguments` is `nil`, an `NSInvalidArgumentException` is raised.

## Return Value

An initialized `NSTask` object with the supplied `arguments`.

## Discussion

The task inherits its environment from the process that invokes this method.

The `NSTask` object converts both `path` and the strings in `arguments` to appropriate C-style strings (using [`fileSystemRepresentation`](/documentation/Foundation/NSString/fileSystemRepresentation)) before passing them to the task via `argv[])` . The strings in `arguments` don’t undergo shell expansion, so you don’t need to do special quoting, and shell variables, such as `$PWD`, aren’t resolved.

## See Also

[`init()`](/documentation/Foundation/Process/init())

Returns an initialized process object with the environment of the current process.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)