1# AbilityRunningInfo (System API)
2
3The **AbilityRunningInfo** module defines the running information and state of an ability.
4
5> **NOTE**
6> 
7> 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.
8> The APIs provided by this module are system APIs.
9
10## Modules to Import
11
12```ts
13import { abilityManager } from '@kit.AbilityKit';
14```
15
16## Usage
17
18The ability running information is obtained by calling [getAbilityRunningInfos](js-apis-app-ability-abilityManager-sys.md#getabilityrunninginfos) in **abilityManager**.
19
20## Attributes
21
22**System capability**: SystemCapability.Ability.AbilityRuntime.Core
23
24**System API**: This is a system API and cannot be called by third-party applications.
25
26| Name | Type | Readable | Writable | Description |
27| -------- | -------- | -------- | -------- | -------- |
28| ability | ElementName | Yes | No | Information that matches an ability. |
29| pid | number | Yes | No | Process ID. |
30| uid | number | Yes | No | User ID. |
31| processName | string | Yes | No | Process name. |
32| startTime | number | Yes | No | Ability start time. |
33| abilityState | [abilityManager.AbilityState](js-apis-app-ability-abilityManager-sys.md#abilitystate) | Yes | No | Ability state. |
34
35**Example**
36
37```ts
38import { abilityManager } from '@kit.AbilityKit';
39
40abilityManager.getAbilityRunningInfos((error, data) => {
41  if (error) {
42    console.error(`getAbilityRunningInfos fail, error: ${JSON.stringify(error)}`);
43  } else {
44    console.log(`getAbilityRunningInfos success, data: ${JSON.stringify(data)}`);
45    for (let i = 0; i < data.length; i++) {
46      let abilityInfo = data[i];
47      console.log(`abilityInfo.ability: ${JSON.stringify(abilityInfo.ability)}`);
48      console.log(`abilityInfo.pid: ${JSON.stringify(abilityInfo.pid)}`);
49      console.log(`abilityInfo.uid: ${JSON.stringify(abilityInfo.uid)}`);
50      console.log(`abilityInfo.processName: ${JSON.stringify(abilityInfo.processName)}`);
51      console.log(`abilityInfo.startTime: ${JSON.stringify(abilityInfo.startTime)}`);
52      console.log(`abilityInfo.abilityState: ${JSON.stringify(abilityInfo.abilityState)}`);
53    }
54  }
55});
56```
57