---
title: NSRunningApplication
framework: appkit
role: symbol
role_heading: Class
path: appkit/nsrunningapplication
---

# NSRunningApplication

An object that can manipulate and provide information for a single instance of an app.

## Declaration

```swift
class NSRunningApplication
```

## Mentioned in

Passing control from one app to another with cooperative activation

## Overview

Overview Some properties of an app are fixed, such as the bundle identifier. Other properties may vary over time, such as whether the app is hidden. Properties that vary can be observed with key-value observing, in which case the description comment for the method notes this capability. Properties that vary over time are inherently race-prone. For example, a hidden app may unhide itself at any time. To ameliorate this, properties persist until the next turn of the main run loop in a common mode. For example, if you repeatedly poll an unhidden app for its hidden property without allowing the run loop to run, it will continue to return false, even if the app hides, until the next turn of the run loop. NSRunningApplication is thread safe, in that its properties are returned atomically. However, it is still subject to the main run loop policy described above. If you access an instance of NSRunningApplication from a background thread, be aware that its time-varying properties may change from under you as the main run loop runs (or not). An NSRunningApplication instance remains valid after the app exits. However, most properties lose their significance, and some properties may not be available on a terminated application. To access the list of all running apps, use the  runningApplications method in NSWorkspace.

## Topics

### Getting running application instances

- [init(processIdentifier:)](appkit/nsrunningapplication/init(processidentifier:).md)
- [runningApplications(withBundleIdentifier:)](appkit/nsrunningapplication/runningapplications(withbundleidentifier:).md)
- [current](appkit/nsrunningapplication/current.md)

### Activating applications

- [activate(options:)](appkit/nsrunningapplication/activate(options:).md)
- [activate(from:options:)](appkit/nsrunningapplication/activate(from:options:).md)
- [isActive](appkit/nsrunningapplication/isactive.md)
- [NSApplication.ActivationOptions](appkit/nsapplication/activationoptions.md)
- [activationPolicy](appkit/nsrunningapplication/activationpolicy.md)
- [NSApplication.ActivationPolicy](appkit/nsapplication/activationpolicy-swift.enum.md)

### Hiding and unhiding applications

- [hide()](appkit/nsrunningapplication/hide().md)
- [unhide()](appkit/nsrunningapplication/unhide().md)
- [isHidden](appkit/nsrunningapplication/ishidden.md)

### Application information

- [localizedName](appkit/nsrunningapplication/localizedname.md)
- [icon](appkit/nsrunningapplication/icon.md)
- [bundleIdentifier](appkit/nsrunningapplication/bundleidentifier.md)
- [bundleURL](appkit/nsrunningapplication/bundleurl.md)
- [executableArchitecture](appkit/nsrunningapplication/executablearchitecture.md)
- [executableURL](appkit/nsrunningapplication/executableurl.md)
- [launchDate](appkit/nsrunningapplication/launchdate.md)
- [isFinishedLaunching](appkit/nsrunningapplication/isfinishedlaunching.md)
- [processIdentifier](appkit/nsrunningapplication/processidentifier.md)
- [ownsMenuBar](appkit/nsrunningapplication/ownsmenubar.md)

### Terminating applications

- [forceTerminate()](appkit/nsrunningapplication/forceterminate().md)
- [terminate()](appkit/nsrunningapplication/terminate().md)
- [isTerminated](appkit/nsrunningapplication/isterminated.md)
- [terminateAutomaticallyTerminableApplications()](appkit/nsrunningapplication/terminateautomaticallyterminableapplications().md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Life Cycle

- [NSApplication](appkit/nsapplication.md)
- [NSApplicationDelegate](appkit/nsapplicationdelegate.md)
- [NSApplicationMain(_:_:)](appkit/nsapplicationmain(_:_:).md)
- [Managing ongoing background processes in your Mac](appkit/managing-ongoing-background-processes-in-your-mac.md)
