LSCopyApplicationURLsForBundleIdentifier(_:_:)
Locates all URLs for apps that correspond to the specified bundle identifier.
Declaration
func LSCopyApplicationURLsForBundleIdentifier(_ inBundleIdentifier: CFString, _ outError: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> Unmanaged<CFArray>?Parameters
- inBundleIdentifier:
The bundle identifier of interest, such as "com.apple.finder". Must not be
NULL. - outError:
On failure, set to a
CFErrordescribing the problem. If you aren't interested in this information, passNULL. The caller is responsible for releasing this object.
Return Value
The URLs for any applications with the specified bundle identifier returned in a CFArray. If no application is found, NULL is returned and outError (if not NULL) is populated with kLSApplicationNotFoundErr.
In macOS 10.15 and later, the returned array is sorted with the first element containing the best available application with the specified bundle identifier. Prior to macOS 10.15, the order of elements in the array was undefined.
The caller is responsible for releasing this array.