<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWorkspace/urlForApplication(withBundleIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWorkspace(im)URLForApplicationWithBundleIdentifier:"
  },
  "title" : "urlForApplication(withBundleIdentifier:)"
}
-->

# urlForApplication(withBundleIdentifier:)

Returns the URL to the default app with the specified bundle identifier.

```
func urlForApplication(withBundleIdentifier bundleIdentifier: String) -> URL?
```

## Parameters

`bundleIdentifier`

The bundle identifier for the app.

## Return Value

The URL of the app, or `nil` if no app has the bundle identifier.

## Discussion

This method uses various heuristics in case multiple apps have the same bundle ID.

You can safely call this method from any thread of your app.

---

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)