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

# processIdentifier

Indicates the process identifier (pid) of the application.

```
var processIdentifier: pid_t { get }
```

## Discussion

Not all applications have a pid.  Applications without a pid return a value of -1.

Do not rely on this for comparing processes, instead compare NSRunningApplication instances using <doc://com.apple.documentation/documentation/ObjectiveC/NSObjectProtocol/isEqual(_:)>.

---

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)