• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ProcessRunningInfo
2
3本模块提供对进程运行信息进行查询的能力。
4
5> **说明:**
6> - 本模块接口从API version 9 开始废弃,建议使用[ProcessInformation<sup>9+</sup>](js-apis-inner-application-processInformation.md)替代。
7> - 本模块首批接口从API version 8 开始支持。
8
9## 属性
10
11**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission
12
13| 名称 | 类型 | 可读 | 可写 | 说明 |
14| -------- | -------- | -------- | -------- | -------- |
15| pid | number | 是 | 否 | 进程ID。 |
16| uid | number | 是 | 否 | 用户ID。 |
17| processName | string | 是 | 否 | 进程名称。 |
18| bundleNames | Array&lt;string&gt; | 是 | 否 | 进程中所有运行的包名称。 |
19
20## 使用说明
21
22通过appManager中[getProcessRunningInfos](js-apis-application-appManager.md#appmanagergetprocessrunninginfosdeprecated)方法来获取。
23
24**示例:**
25```ts
26import appManager from '@ohos.application.appManager';
27
28appManager.getProcessRunningInfos().then((data) => {
29    console.log('success:' + JSON.stringify(data));
30}).catch((error) => {
31    console.log('failed:' + JSON.stringify(error));
32});
33```
34