js-apis-processrunninginfo.md 1.0 KB
Newer Older
W
wusongqing 已提交
1 2
# ProcessRunningInfo

W
wusongqing 已提交
3 4
> **NOTE**
>
Z
zengyawen 已提交
5
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
W
wusongqing 已提交
6 7 8 9


Provides process running information.

W
wusongqing 已提交
10 11 12 13 14
## Modules to Import

```js
import appManager from '@ohos.application.appManager'
```
W
wusongqing 已提交
15 16 17 18 19 20

## Usage


The process running information is obtained through an **appManager** instance.

W
wusongqing 已提交
21
```js
W
wusongqing 已提交
22 23 24 25 26 27 28 29 30
import appManager from '@ohos.application.appManager';
appManager.getProcessRunningInfos((error,data) => { 
    console.log("getProcessRunningInfos error: "  + error.code + " data: " + JSON.stringify(data));
});
```


## Attributes

W
wusongqing 已提交
31 32
**System capability**: SystemCapability.Ability.AbilityRuntime.Core

W
wusongqing 已提交
33
| Name| Type| Readable| Writable| Description|
W
wusongqing 已提交
34
| -------- | -------- | -------- | -------- | -------- |
W
wusongqing 已提交
35 36 37 38
| pid | number | Yes| No| Process ID.|
| uid | number | Yes| No| User ID.|
| processName | string | Yes| No| Process name.|
| bundleNames | Array<string> | Yes| No| Names of all bundles running in the process.|