launchApplication(at:options:configuration:)
Launches the app at the specified URL.
Declaration
func launchApplication(at url: URL, options: NSWorkspace.LaunchOptions = [], configuration: [NSWorkspace.LaunchConfigurationKey : Any]) throws -> NSRunningApplicationParameters
- url:
The application URL.
- options:
Options to use when launching the application. See 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
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
It is safe to call this method from any thread in your app in macOS 10.6 and later.
See Also
Methods
open(_:options:configuration:)open(_:withApplicationAt:options:configuration:)openFile(_:)openFile(_:withApplication:)openFile(_:withApplication:andDeactivate:)openFile(_:from:at:in:)launchApplication(_:)launchApplication(_:showIcon:autolaunch:)performFileOperation(_:source:destination:files:tag:)fullPath(forApplication:)absolutePathForApplication(withBundleIdentifier:)launchApplication(withBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier:)open(_:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:)mountedRemovableMedia()mountedLocalVolumePaths()