<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWorkspace/openApplication(at:configuration:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWorkspace(im)openApplicationAtURL:configuration:completionHandler:"
  },
  "title" : "openApplication(at:configuration:completionHandler:)"
}
-->

# openApplication(at:configuration:completionHandler:)

Launches the app at the specified URL and asynchronously reports back on the app’s status.

```
func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: (@Sendable (NSRunningApplication?, (any Error)?) -> Void)? = nil)
```

```
func openApplication(at applicationURL: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication
```

## Parameters

`applicationURL`

A URL specifying the location of the app in the file system.

`configuration`

The options that indicate how you want to launch the app.

`completionHandler`

The completion handler block to call asynchronously with the results. AppKit executes the completion handler on a concurrent queue. The handler block has no return value and takes the following parameters:

- app: On success, this parameter contains a reference to the launched app. If the app wasn’t launched, this parameter is `nil`.
- error: On failure, this parameter contains an <doc://com.apple.documentation/documentation/Foundation/NSError> object indicating the reason for the failure. If the app launched successfully, this parameter is `nil`.

## Discussion

---

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)