---
title: "launchApplication(at:options:configuration:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsworkspace/launchapplication(at:options:configuration:)"
---

# launchApplication(at:options:configuration:)

Launches the app at the specified URL.

## Declaration

```swift
func launchApplication(at url: URL, options: NSWorkspace.LaunchOptions = [], configuration: [NSWorkspace.LaunchConfigurationKey : Any]) throws -> NSRunningApplication
```

## Parameters

- `url`: The application URL.
- `options`: Options to use when launching the application. See doc://com.apple.appkit/documentation/AppKit/NSWorkspace/LaunchOptions for possible values.
- `configuration`: A dictionary containing the configuration options. This dictionary can be used to pass additional options to the app. The configuration dictionary may be empty, in which case default behavior applies.

## Return Value

Return Value If the app is already running, and newInstance is not specified in the options dictionary, then a reference to the existing app is returned; otherwise a new application reference is returned. If the application could not be launched, nil is returned and the error is specified in error.

## Discussion

Discussion It is safe to call this method from any thread in your app in macOS 10.6 and later. note: In Swift, this method returns a nonoptional result and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Methods

- [open(_:options:configuration:)](appkit/nsworkspace/open(_:options:configuration:).md)
- [open(_:withApplicationAt:options:configuration:)](appkit/nsworkspace/open(_:withapplicationat:options:configuration:).md)
- [openFile(_:)](appkit/nsworkspace/openfile(_:).md)
- [openFile(_:withApplication:)](appkit/nsworkspace/openfile(_:withapplication:).md)
- [openFile(_:withApplication:andDeactivate:)](appkit/nsworkspace/openfile(_:withapplication:anddeactivate:).md)
- [openFile(_:from:at:in:)](appkit/nsworkspace/openfile(_:from:at:in:).md)
- [launchApplication(_:)](appkit/nsworkspace/launchapplication(_:).md)
- [launchApplication(_:showIcon:autolaunch:)](appkit/nsworkspace/launchapplication(_:showicon:autolaunch:).md)
- [performFileOperation(_:source:destination:files:tag:)](appkit/nsworkspace/performfileoperation(_:source:destination:files:tag:).md)
- [fullPath(forApplication:)](appkit/nsworkspace/fullpath(forapplication:).md)
- [absolutePathForApplication(withBundleIdentifier:)](appkit/nsworkspace/absolutepathforapplication(withbundleidentifier:).md)
- [launchApplication(withBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier:)](appkit/nsworkspace/launchapplication(withbundleidentifier:options:additionaleventparamdescriptor:launchidentifier:).md)
- [open(_:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:)](appkit/nsworkspace/open(_:withappbundleidentifier:options:additionaleventparamdescriptor:launchidentifiers:).md)
- [mountedRemovableMedia()](appkit/nsworkspace/mountedremovablemedia().md)
- [mountedLocalVolumePaths()](appkit/nsworkspace/mountedlocalvolumepaths().md)
