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

# activate()

Activates the receiver app, if appropriate.

```
func activate()
```

## Discussion

Use this method to request app activation; calling this method doesn’t guarantee app activation. For cooperative activation, the other app should call [`yieldActivation(to:)`](/documentation/AppKit/NSApplication/yieldActivation(to:)) or equivalent before the target app invokes [`activate()`](/documentation/AppKit/NSApplication/activate()).

Invoking [`activate()`](/documentation/AppKit/NSApplication/activate()) on an already-active application cancels any pending activation yields by the receiver.

---

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)