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

# launch()

Launches the task represented by the receiver.

```
func launch()
```

## Discussion

Raises an `NSInvalidArgumentException` if the launch path has not been set or is invalid or if it fails to create a process.

## See Also

[`-  waitUntilExit`](/documentation/Foundation/Process/waitUntilExit())

Blocks the process until the receiver is finished.

[`-  terminate`](/documentation/Foundation/Process/terminate())

Sends a terminate signal to the receiver and all of its subtasks.



---

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)