ProcessRunningInfo
The module defines the running information of a process. The information can be obtained through getProcessRunningInfos of appManager.
NOTE
- The APIs provided by this module are deprecated since API version 9. You are advised to use ProcessInformation9+ instead.
- The initial APIs of this module are supported since API version 8.
Modules to Import
import appManager from '@ohos.application.appManager';
Attributes
System capability: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Read-Only | Optional | Description |
|---|---|---|---|---|
| pid | number | No | No | Process ID. |
| uid | number | No | No | UID of the application. |
| processName | string | No | No | Process name. |
| bundleNames | Array<string> | No | No | Names of all running bundles in the process. |
Example
import appManager from '@ohos.application.appManager';
import { BusinessError } from '@ohos.base';
appManager.getProcessRunningInfos().then((data) => {
console.info(`success: ${JSON.stringify(data)}`);
}).catch((error: BusinessError) => {
console.error(`failed: ${JSON.stringify(error)}`);
});