You need to sign in or sign up before continuing.
js-apis-processrunninginfo.md 1.0 KB
Newer Older
W
wusongqing 已提交
1 2
# ProcessRunningInfo

W
wusongqing 已提交
3
> **NOTE**<br>
W
wusongqing 已提交
4
> 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 已提交
5 6 7 8


Provides process running information.

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

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

## Usage


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


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


## Attributes

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

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