• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ProcessRunningInfo
2
3The **ProcessRunningInfo** module defines the running information of a process.
4
5> **NOTE**
6> - The APIs provided by this module are deprecated since API version 9. You are advised to use [ProcessInformation<sup>9+</sup>](js-apis-inner-application-processInformation.md) instead.
7> - The initial APIs of this module are supported since API version 8.
8
9## Modules to Import
10
11```ts
12import appManager from '@ohos.application.appManager';
13```
14
15## Attributes
16
17**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
18
19| Name| Type| Readable| Writable| Description|
20| -------- | -------- | -------- | -------- | -------- |
21| pid | number | Yes| No| Process ID.|
22| uid | number | Yes| No| User ID.|
23| processName | string | Yes| No| Process name.|
24| bundleNames | Array&lt;string&gt; | Yes| No| Names of all running bundles in the process.|
25
26## Usage
27
28The process running information is obtained by using [getProcessRunningInfos](js-apis-application-appManager.md#appmanagergetprocessrunninginfosdeprecated) in **appManager**.
29
30**Example**
31```ts
32import appManager from '@ohos.application.appManager';
33import { BusinessError } from '@ohos.base';
34
35appManager.getProcessRunningInfos().then((data) => {
36    console.log(`success: ${JSON.stringify(data)}`);
37}).catch((error: BusinessError) => {
38    console.error(`failed: ${JSON.stringify(error)}`);
39});
40```
41