1e41f4b71Sopenharmony_ci# @ohos.app.ability.appManager (appManager) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **appManager** module implements application management. You can use the APIs of this module to query whether the application is undergoing a stability test, whether the application is running on a RAM constrained device, the memory size of the application, and information about the running process. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## Modules to Import 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci```ts 12e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit'; 13e41f4b71Sopenharmony_ci``` 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## ProcessState<sup>10+</sup> 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciEnumerates the processes states. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci| Name | Value | Description | 24e41f4b71Sopenharmony_ci| -------------------- | --- | --------------------------------- | 25e41f4b71Sopenharmony_ci| STATE_CREATE | 0 | The process is being created. | 26e41f4b71Sopenharmony_ci| STATE_FOREGROUND | 1 | The process is running in the foreground. | 27e41f4b71Sopenharmony_ci| STATE_ACTIVE | 2 | The process is active. | 28e41f4b71Sopenharmony_ci| STATE_BACKGROUND | 3 | The process is running in the background. | 29e41f4b71Sopenharmony_ci| STATE_DESTROY | 4 | The process is being destroyed. | 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci## appManager.isRunningInStabilityTest 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ciisRunningInStabilityTest(callback: AsyncCallback<boolean>): void 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ciChecks whether this application is undergoing a stability test. This API uses an asynchronous callback to return the result. 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci**Parameters** 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci | Name| Type| Mandatory| Description| 44e41f4b71Sopenharmony_ci | -------- | -------- | -------- | -------- | 45e41f4b71Sopenharmony_ci | callback | AsyncCallback<boolean> | Yes|Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite. | 46e41f4b71Sopenharmony_ci 47e41f4b71Sopenharmony_ci**Error codes** 48e41f4b71Sopenharmony_ci 49e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Ability Error Codes](errorcode-ability.md). 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ci| ID| Error Message| 52e41f4b71Sopenharmony_ci| ------- | -------- | 53e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 54e41f4b71Sopenharmony_ci| 16000050 | Internal error. | 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci**Example** 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ci```ts 59e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit'; 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ciappManager.isRunningInStabilityTest((err, flag) => { 62e41f4b71Sopenharmony_ci if (err) { 63e41f4b71Sopenharmony_ci console.error(`isRunningInStabilityTest fail, err: ${JSON.stringify(err)}`); 64e41f4b71Sopenharmony_ci } else { 65e41f4b71Sopenharmony_ci console.log(`The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}`); 66e41f4b71Sopenharmony_ci } 67e41f4b71Sopenharmony_ci}); 68e41f4b71Sopenharmony_ci``` 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci 71e41f4b71Sopenharmony_ci## appManager.isRunningInStabilityTest 72e41f4b71Sopenharmony_ci 73e41f4b71Sopenharmony_ciisRunningInStabilityTest(): Promise<boolean> 74e41f4b71Sopenharmony_ci 75e41f4b71Sopenharmony_ciChecks whether this application is undergoing a stability test. This API uses a promise to return the result. 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 80e41f4b71Sopenharmony_ci 81e41f4b71Sopenharmony_ci**Return value** 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ci | Type| Description| 84e41f4b71Sopenharmony_ci | -------- | -------- | 85e41f4b71Sopenharmony_ci | Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.| 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci**Error codes** 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ciFor details about the error codes, see [Ability Error Codes](errorcode-ability.md). 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ci| ID| Error Message| 92e41f4b71Sopenharmony_ci| ------- | -------- | 93e41f4b71Sopenharmony_ci| 16000050 | Internal error. | 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ci**Example** 96e41f4b71Sopenharmony_ci 97e41f4b71Sopenharmony_ci```ts 98e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit'; 99e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 100e41f4b71Sopenharmony_ci 101e41f4b71Sopenharmony_ciappManager.isRunningInStabilityTest().then((flag) => { 102e41f4b71Sopenharmony_ci console.log(`The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}`); 103e41f4b71Sopenharmony_ci}).catch((error: BusinessError) => { 104e41f4b71Sopenharmony_ci console.error(`error: ${JSON.stringify(error)}`); 105e41f4b71Sopenharmony_ci}); 106e41f4b71Sopenharmony_ci``` 107e41f4b71Sopenharmony_ci 108e41f4b71Sopenharmony_ci 109e41f4b71Sopenharmony_ci## appManager.isRamConstrainedDevice 110e41f4b71Sopenharmony_ci 111e41f4b71Sopenharmony_ciisRamConstrainedDevice(): Promise\<boolean> 112e41f4b71Sopenharmony_ci 113e41f4b71Sopenharmony_ciChecks whether this application is running on a RAM constrained device. This API uses a promise to return the result. 114e41f4b71Sopenharmony_ci 115e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 116e41f4b71Sopenharmony_ci 117e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 118e41f4b71Sopenharmony_ci 119e41f4b71Sopenharmony_ci**Return value** 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_ci | Type| Description| 122e41f4b71Sopenharmony_ci | -------- | -------- | 123e41f4b71Sopenharmony_ci | Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.| 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ci**Error codes** 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ciFor details about the error codes, see [Ability Error Codes](errorcode-ability.md). 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ci| ID| Error Message| 130e41f4b71Sopenharmony_ci| ------- | -------- | 131e41f4b71Sopenharmony_ci| 16000050 | Internal error. | 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ci**Example** 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci```ts 136e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit'; 137e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ciappManager.isRamConstrainedDevice().then((data) => { 140e41f4b71Sopenharmony_ci console.log(`The result of isRamConstrainedDevice is: ${JSON.stringify(data)}`); 141e41f4b71Sopenharmony_ci}).catch((error: BusinessError) => { 142e41f4b71Sopenharmony_ci console.error(`error: ${JSON.stringify(error)}`); 143e41f4b71Sopenharmony_ci}); 144e41f4b71Sopenharmony_ci``` 145e41f4b71Sopenharmony_ci 146e41f4b71Sopenharmony_ci## appManager.isRamConstrainedDevice 147e41f4b71Sopenharmony_ci 148e41f4b71Sopenharmony_ciisRamConstrainedDevice(callback: AsyncCallback\<boolean>): void 149e41f4b71Sopenharmony_ci 150e41f4b71Sopenharmony_ciChecks whether this application is running on a RAM constrained device. This API uses an asynchronous callback to return the result. 151e41f4b71Sopenharmony_ci 152e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 153e41f4b71Sopenharmony_ci 154e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 155e41f4b71Sopenharmony_ci 156e41f4b71Sopenharmony_ci**Parameters** 157e41f4b71Sopenharmony_ci 158e41f4b71Sopenharmony_ci | Name| Type| Mandatory| Description| 159e41f4b71Sopenharmony_ci | -------- | -------- | -------- | -------- | 160e41f4b71Sopenharmony_ci | callback | AsyncCallback<boolean> | Yes|Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite. | 161e41f4b71Sopenharmony_ci 162e41f4b71Sopenharmony_ci**Error codes** 163e41f4b71Sopenharmony_ci 164e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Ability Error Codes](errorcode-ability.md). 165e41f4b71Sopenharmony_ci 166e41f4b71Sopenharmony_ci| ID| Error Message| 167e41f4b71Sopenharmony_ci| ------- | -------- | 168e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 169e41f4b71Sopenharmony_ci| 16000050 | Internal error. | 170e41f4b71Sopenharmony_ci 171e41f4b71Sopenharmony_ci**Example** 172e41f4b71Sopenharmony_ci 173e41f4b71Sopenharmony_ci```ts 174e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit'; 175e41f4b71Sopenharmony_ci 176e41f4b71Sopenharmony_ciappManager.isRamConstrainedDevice((err, data) => { 177e41f4b71Sopenharmony_ci if (err) { 178e41f4b71Sopenharmony_ci console.error(`isRamConstrainedDevice fail, err: ${JSON.stringify(err)}`); 179e41f4b71Sopenharmony_ci } else { 180e41f4b71Sopenharmony_ci console.log(`The result of isRamConstrainedDevice is: ${JSON.stringify(data)}`); 181e41f4b71Sopenharmony_ci } 182e41f4b71Sopenharmony_ci}); 183e41f4b71Sopenharmony_ci``` 184e41f4b71Sopenharmony_ci 185e41f4b71Sopenharmony_ci## appManager.getAppMemorySize 186e41f4b71Sopenharmony_ci 187e41f4b71Sopenharmony_cigetAppMemorySize(): Promise\<number> 188e41f4b71Sopenharmony_ci 189e41f4b71Sopenharmony_ciObtains the memory size of this application. This API uses a promise to return the result. 190e41f4b71Sopenharmony_ci 191e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 192e41f4b71Sopenharmony_ci 193e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 194e41f4b71Sopenharmony_ci 195e41f4b71Sopenharmony_ci**Return value** 196e41f4b71Sopenharmony_ci 197e41f4b71Sopenharmony_ci | Type| Description| 198e41f4b71Sopenharmony_ci | -------- | -------- | 199e41f4b71Sopenharmony_ci | Promise<number> | Promise used to return the memory size, in MB. You can perform error processing or other custom processing based on the size. | 200e41f4b71Sopenharmony_ci 201e41f4b71Sopenharmony_ci**Error codes** 202e41f4b71Sopenharmony_ci 203e41f4b71Sopenharmony_ciFor details about the error codes, see [Ability Error Codes](errorcode-ability.md). 204e41f4b71Sopenharmony_ci 205e41f4b71Sopenharmony_ci| ID| Error Message| 206e41f4b71Sopenharmony_ci| ------- | -------- | 207e41f4b71Sopenharmony_ci| 16000050 | Internal error. | 208e41f4b71Sopenharmony_ci 209e41f4b71Sopenharmony_ci**Example** 210e41f4b71Sopenharmony_ci 211e41f4b71Sopenharmony_ci```ts 212e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit'; 213e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 214e41f4b71Sopenharmony_ci 215e41f4b71Sopenharmony_ciappManager.getAppMemorySize().then((data) => { 216e41f4b71Sopenharmony_ci console.log(`The size of app memory is: ${JSON.stringify(data)}`); 217e41f4b71Sopenharmony_ci}).catch((error: BusinessError) => { 218e41f4b71Sopenharmony_ci console.error(`error: ${JSON.stringify(error)}`); 219e41f4b71Sopenharmony_ci}); 220e41f4b71Sopenharmony_ci``` 221e41f4b71Sopenharmony_ci 222e41f4b71Sopenharmony_ci## appManager.getAppMemorySize 223e41f4b71Sopenharmony_ci 224e41f4b71Sopenharmony_cigetAppMemorySize(callback: AsyncCallback\<number>): void 225e41f4b71Sopenharmony_ci 226e41f4b71Sopenharmony_ciObtains the memory size of this application. This API uses an asynchronous callback to return the result. 227e41f4b71Sopenharmony_ci 228e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 229e41f4b71Sopenharmony_ci 230e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 231e41f4b71Sopenharmony_ci 232e41f4b71Sopenharmony_ci**Parameters** 233e41f4b71Sopenharmony_ci 234e41f4b71Sopenharmony_ci | Name| Type| Mandatory| Description| 235e41f4b71Sopenharmony_ci | -------- | -------- | -------- | -------- | 236e41f4b71Sopenharmony_ci | callback | AsyncCallback<number> | Yes|Callback used to return the memory size, in MB. You can perform error processing or other custom processing based on the size. | 237e41f4b71Sopenharmony_ci 238e41f4b71Sopenharmony_ci**Error codes** 239e41f4b71Sopenharmony_ci 240e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Ability Error Codes](errorcode-ability.md). 241e41f4b71Sopenharmony_ci 242e41f4b71Sopenharmony_ci| ID| Error Message| 243e41f4b71Sopenharmony_ci| ------- | -------- | 244e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 245e41f4b71Sopenharmony_ci| 16000050 | Internal error. | 246e41f4b71Sopenharmony_ci 247e41f4b71Sopenharmony_ci**Example** 248e41f4b71Sopenharmony_ci 249e41f4b71Sopenharmony_ci```ts 250e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit'; 251e41f4b71Sopenharmony_ci 252e41f4b71Sopenharmony_ciappManager.getAppMemorySize((err, data) => { 253e41f4b71Sopenharmony_ci if (err) { 254e41f4b71Sopenharmony_ci console.error(`getAppMemorySize fail, err: ${JSON.stringify(err)}`); 255e41f4b71Sopenharmony_ci } else { 256e41f4b71Sopenharmony_ci console.log(`The size of app memory is: ${JSON.stringify(data)}`); 257e41f4b71Sopenharmony_ci } 258e41f4b71Sopenharmony_ci}); 259e41f4b71Sopenharmony_ci``` 260e41f4b71Sopenharmony_ci 261e41f4b71Sopenharmony_ci## appManager.getRunningProcessInformation 262e41f4b71Sopenharmony_ci 263e41f4b71Sopenharmony_cigetRunningProcessInformation(): Promise\<Array\<ProcessInformation>> 264e41f4b71Sopenharmony_ci 265e41f4b71Sopenharmony_ciObtains information about the running processes. This API uses a promise to return the result. 266e41f4b71Sopenharmony_ci 267e41f4b71Sopenharmony_ci> **NOTE** 268e41f4b71Sopenharmony_ci> 269e41f4b71Sopenharmony_ci> In versions earlier than API version 11, this API requires the **ohos.permission.GET_RUNNING_INFO** permission, which is available only for system applications. Since API version 11, no permission is required for calling this API. 270e41f4b71Sopenharmony_ci 271e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 272e41f4b71Sopenharmony_ci 273e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 274e41f4b71Sopenharmony_ci 275e41f4b71Sopenharmony_ci**Return value** 276e41f4b71Sopenharmony_ci 277e41f4b71Sopenharmony_ci| Type| Description| 278e41f4b71Sopenharmony_ci| -------- | -------- | 279e41f4b71Sopenharmony_ci| Promise\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | Promise used to return the API call result and the process running information. You can perform error handling or custom processing in this callback.| 280e41f4b71Sopenharmony_ci 281e41f4b71Sopenharmony_ci**Error codes** 282e41f4b71Sopenharmony_ci 283e41f4b71Sopenharmony_ciFor details about the error codes, see [Ability Error Codes](errorcode-ability.md). 284e41f4b71Sopenharmony_ci 285e41f4b71Sopenharmony_ci| ID| Error Message| 286e41f4b71Sopenharmony_ci| ------- | -------- | 287e41f4b71Sopenharmony_ci| 16000050 | Internal error. | 288e41f4b71Sopenharmony_ci 289e41f4b71Sopenharmony_ci**Example** 290e41f4b71Sopenharmony_ci 291e41f4b71Sopenharmony_ci```ts 292e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit'; 293e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 294e41f4b71Sopenharmony_ci 295e41f4b71Sopenharmony_ciappManager.getRunningProcessInformation().then((data) => { 296e41f4b71Sopenharmony_ci console.log(`The running process information is: ${JSON.stringify(data)}`); 297e41f4b71Sopenharmony_ci}).catch((error: BusinessError) => { 298e41f4b71Sopenharmony_ci console.error(`error: ${JSON.stringify(error)}`); 299e41f4b71Sopenharmony_ci}); 300e41f4b71Sopenharmony_ci``` 301e41f4b71Sopenharmony_ci 302e41f4b71Sopenharmony_ci## appManager.getRunningProcessInformation 303e41f4b71Sopenharmony_ci 304e41f4b71Sopenharmony_cigetRunningProcessInformation(callback: AsyncCallback\<Array\<ProcessInformation>>): void 305e41f4b71Sopenharmony_ci 306e41f4b71Sopenharmony_ciObtains information about the running processes. This API uses an asynchronous callback to return the result. 307e41f4b71Sopenharmony_ci 308e41f4b71Sopenharmony_ci> **NOTE** 309e41f4b71Sopenharmony_ci> 310e41f4b71Sopenharmony_ci> In versions earlier than API version 11, this API requires the **ohos.permission.GET_RUNNING_INFO** permission, which is available only for system applications. Since API version 11, no permission is required for calling this API. 311e41f4b71Sopenharmony_ci 312e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 313e41f4b71Sopenharmony_ci 314e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 315e41f4b71Sopenharmony_ci 316e41f4b71Sopenharmony_ci**Parameters** 317e41f4b71Sopenharmony_ci 318e41f4b71Sopenharmony_ci | Name| Type| Mandatory| Description| 319e41f4b71Sopenharmony_ci | -------- | -------- | -------- | -------- | 320e41f4b71Sopenharmony_ci | callback | AsyncCallback\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | Yes|Callback used to return the API call result and the process running information. You can perform error handling or custom processing in this callback.| 321e41f4b71Sopenharmony_ci 322e41f4b71Sopenharmony_ci**Error codes** 323e41f4b71Sopenharmony_ci 324e41f4b71Sopenharmony_ciFor details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Ability Error Codes](errorcode-ability.md). 325e41f4b71Sopenharmony_ci 326e41f4b71Sopenharmony_ci| ID| Error Message| 327e41f4b71Sopenharmony_ci| ------- | -------- | 328e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 329e41f4b71Sopenharmony_ci| 16000050 | Internal error. | 330e41f4b71Sopenharmony_ci 331e41f4b71Sopenharmony_ci**Example** 332e41f4b71Sopenharmony_ci 333e41f4b71Sopenharmony_ci```ts 334e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit'; 335e41f4b71Sopenharmony_ci 336e41f4b71Sopenharmony_ciappManager.getRunningProcessInformation((err, data) => { 337e41f4b71Sopenharmony_ci if (err) { 338e41f4b71Sopenharmony_ci console.error(`getRunningProcessInformation fail, err: ${JSON.stringify(err)}`); 339e41f4b71Sopenharmony_ci } else { 340e41f4b71Sopenharmony_ci console.log(`The running process information is: ${JSON.stringify(data)}`); 341e41f4b71Sopenharmony_ci } 342e41f4b71Sopenharmony_ci}); 343e41f4b71Sopenharmony_ci``` 344