---
title: "init(processIdentifier:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsrunningapplication/init(processidentifier:)"
---

# init(processIdentifier:)

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

## Declaration

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

## Parameters

- `pid`: The process identifier.

## Return Value

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

## Discussion

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

## See Also

### Getting running application instances

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