<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSRunningApplication/init(processIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSRunningApplication(cm)runningApplicationWithProcessIdentifier:"
  },
  "title" : "init(processIdentifier:)"
}
-->

# init(processIdentifier:)

Returns the running application with the given process identifier, or nil if no application has that pid.

```
convenience init?(processIdentifier pid: pid_t)
```

## Parameters

`pid`

The process identifier.

## Return Value

An instance of `NSRunningApplication` for the specified `pid`, or nil if the application has no process identifier.

## Discussion

Applications that do not have `PIDs` cannot be returned from this method.

---

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)