1e41f4b71Sopenharmony_ci# @ohos.app.ability.appManager (appManager)
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciappManager模块提供App管理的能力,包括查询当前是否处于稳定性测试场景、查询是否为ram受限设备、获取应用程序的内存大小、获取有关运行进程的信息等。
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci> **说明:**
6e41f4b71Sopenharmony_ci> 
7e41f4b71Sopenharmony_ci> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci## 导入模块
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci```ts
12e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit';
13e41f4b71Sopenharmony_ci```
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci## ProcessState<sup>10+</sup>
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci表示进程状态的枚举。
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci| 名称                 | 值  | 说明                               |
24e41f4b71Sopenharmony_ci| -------------------- | --- | --------------------------------- |
25e41f4b71Sopenharmony_ci| STATE_CREATE    | 0   |    进程处于创建状态。       |
26e41f4b71Sopenharmony_ci| STATE_FOREGROUND          | 1   |    进程处于前台状态。      |
27e41f4b71Sopenharmony_ci| STATE_ACTIVE  | 2   |     进程处于获焦状态。   |
28e41f4b71Sopenharmony_ci| STATE_BACKGROUND        | 3   |    进程处于后台不可见状态。           |
29e41f4b71Sopenharmony_ci| STATE_DESTROY        | 4   |    进程处于销毁状态。         |
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci## appManager.isRunningInStabilityTest
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ciisRunningInStabilityTest(callback: AsyncCallback&lt;boolean&gt;): void
34e41f4b71Sopenharmony_ci
35e41f4b71Sopenharmony_ci查询当前是否处于稳定性测试场景。使用callback异步回调。
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ci**参数:**
42e41f4b71Sopenharmony_ci
43e41f4b71Sopenharmony_ci  | 参数名 | 类型 | 必填 | 说明 | 
44e41f4b71Sopenharmony_ci  | -------- | -------- | -------- | -------- |
45e41f4b71Sopenharmony_ci  | callback | AsyncCallback&lt;boolean&gt; | 是 |以回调方式返回接口运行结果及当前是否处于稳定性测试场景,可进行错误处理或其他自定义处理。true: 处于稳定性测试场景,false:处于非稳定性测试场景。  | 
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ci**错误码**:
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci以下错误码详细介绍请参考[通用错误码](../errorcode-universal.md)和[元能力子系统错误码](errorcode-ability.md)。
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 |
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**示例:**
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&lt;boolean&gt;
74e41f4b71Sopenharmony_ci
75e41f4b71Sopenharmony_ci查询当前是否处于稳定性测试场景。使用Promise异步回调。
76e41f4b71Sopenharmony_ci
77e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
78e41f4b71Sopenharmony_ci
79e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
80e41f4b71Sopenharmony_ci
81e41f4b71Sopenharmony_ci**返回值:**
82e41f4b71Sopenharmony_ci
83e41f4b71Sopenharmony_ci  | 类型 | 说明 | 
84e41f4b71Sopenharmony_ci  | -------- | -------- |
85e41f4b71Sopenharmony_ci  | Promise&lt;boolean&gt; | 以Promise方式返回接口运行结果及当前是否处于稳定性测试场景,可进行错误处理或其他自定义处理。true: 处于稳定性测试场景,false:处于非稳定性测试场景。 | 
86e41f4b71Sopenharmony_ci
87e41f4b71Sopenharmony_ci**错误码**:
88e41f4b71Sopenharmony_ci
89e41f4b71Sopenharmony_ci以下错误码详细介绍请参考[元能力子系统错误码](errorcode-ability.md)。
90e41f4b71Sopenharmony_ci
91e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 |
92e41f4b71Sopenharmony_ci| ------- | -------- |
93e41f4b71Sopenharmony_ci| 16000050 | Internal error. |
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci**示例:**
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_ci查询是否为ram受限设备。使用Promise异步回调。
114e41f4b71Sopenharmony_ci
115e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
116e41f4b71Sopenharmony_ci
117e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ci**返回值:**
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci  | 类型 | 说明 | 
122e41f4b71Sopenharmony_ci  | -------- | -------- |
123e41f4b71Sopenharmony_ci  | Promise&lt;boolean&gt; | 以Promise方式返回接口运行结果及当前设备是否为ram受限设备,可进行错误处理或其他自定义处理。true:当前设备为ram受限设备,false:当前设备为非ram受限设备。 | 
124e41f4b71Sopenharmony_ci
125e41f4b71Sopenharmony_ci**错误码**:
126e41f4b71Sopenharmony_ci
127e41f4b71Sopenharmony_ci以下错误码详细介绍请参考[元能力子系统错误码](errorcode-ability.md)。
128e41f4b71Sopenharmony_ci
129e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 |
130e41f4b71Sopenharmony_ci| ------- | -------- |
131e41f4b71Sopenharmony_ci| 16000050 | Internal error. |
132e41f4b71Sopenharmony_ci
133e41f4b71Sopenharmony_ci**示例:**
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_ci查询是否为ram受限设备。使用callback异步回调。
151e41f4b71Sopenharmony_ci
152e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
153e41f4b71Sopenharmony_ci
154e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
155e41f4b71Sopenharmony_ci
156e41f4b71Sopenharmony_ci**参数:**
157e41f4b71Sopenharmony_ci
158e41f4b71Sopenharmony_ci  | 参数名 | 类型 | 必填 | 说明 | 
159e41f4b71Sopenharmony_ci  | -------- | -------- | -------- | -------- |
160e41f4b71Sopenharmony_ci  | callback | AsyncCallback&lt;boolean&gt; | 是 |以回调方式返回接口运行结果及当前设备是否为ram受限设备,可进行错误处理或其他自定义处理。true:当前设备为ram受限设备,false:当前设备为非ram受限设备。  | 
161e41f4b71Sopenharmony_ci
162e41f4b71Sopenharmony_ci**错误码**:
163e41f4b71Sopenharmony_ci
164e41f4b71Sopenharmony_ci以下错误码详细介绍请参考[通用错误码](../errorcode-universal.md)和[元能力子系统错误码](errorcode-ability.md)。
165e41f4b71Sopenharmony_ci
166e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 |
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**示例:**
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_ci获取当前应用程序可以使用的内存的值。使用Promise异步回调。
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
192e41f4b71Sopenharmony_ci
193e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
194e41f4b71Sopenharmony_ci
195e41f4b71Sopenharmony_ci**返回值:**
196e41f4b71Sopenharmony_ci
197e41f4b71Sopenharmony_ci  | 类型 | 说明 | 
198e41f4b71Sopenharmony_ci  | -------- | -------- |
199e41f4b71Sopenharmony_ci  | Promise&lt;number&gt; | 获取当前应用程序可以使用的内存的值,可根据此值进行错误处理或其他自定义处理,单位是M。使用Promise异步回调。| 
200e41f4b71Sopenharmony_ci
201e41f4b71Sopenharmony_ci**错误码**:
202e41f4b71Sopenharmony_ci
203e41f4b71Sopenharmony_ci以下错误码详细介绍请参考[元能力子系统错误码](errorcode-ability.md)。
204e41f4b71Sopenharmony_ci
205e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 |
206e41f4b71Sopenharmony_ci| ------- | -------- |
207e41f4b71Sopenharmony_ci| 16000050 | Internal error. |
208e41f4b71Sopenharmony_ci
209e41f4b71Sopenharmony_ci**示例:**
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_ci获取当前应用程序可以使用的内存的值。使用callback异步回调。
227e41f4b71Sopenharmony_ci
228e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
229e41f4b71Sopenharmony_ci
230e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
231e41f4b71Sopenharmony_ci
232e41f4b71Sopenharmony_ci**参数:**
233e41f4b71Sopenharmony_ci
234e41f4b71Sopenharmony_ci  | 参数名 | 类型 | 必填 | 说明 | 
235e41f4b71Sopenharmony_ci  | -------- | -------- | -------- | -------- |
236e41f4b71Sopenharmony_ci  | callback | AsyncCallback&lt;number&gt; | 是 |获取当前应用程序可以使用的内存的值,可根据此值进行错误处理或其他自定义处理,单位是M。使用callback异步回调。| 
237e41f4b71Sopenharmony_ci
238e41f4b71Sopenharmony_ci**错误码**:
239e41f4b71Sopenharmony_ci
240e41f4b71Sopenharmony_ci以下错误码详细介绍请参考[通用错误码](../errorcode-universal.md)和[元能力子系统错误码](errorcode-ability.md)。
241e41f4b71Sopenharmony_ci
242e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 |
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**示例:**
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_ci获取当前运行进程的有关信息。使用Promise异步回调。
266e41f4b71Sopenharmony_ci
267e41f4b71Sopenharmony_ci> **说明:**
268e41f4b71Sopenharmony_ci>
269e41f4b71Sopenharmony_ci> API version 11之前的版本,该接口需要申请权限ohos.permission.GET_RUNNING_INFO(该权限仅系统应用可申请)。从API version 11开始,该接口不再需要申请权限。
270e41f4b71Sopenharmony_ci
271e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
272e41f4b71Sopenharmony_ci
273e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
274e41f4b71Sopenharmony_ci
275e41f4b71Sopenharmony_ci**返回值:**
276e41f4b71Sopenharmony_ci
277e41f4b71Sopenharmony_ci| 类型 | 说明 |
278e41f4b71Sopenharmony_ci| -------- | -------- |
279e41f4b71Sopenharmony_ci| Promise\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | 以Promise方式返回接口运行结果及有关运行进程的信息,可进行错误处理或其他自定义处理。 |
280e41f4b71Sopenharmony_ci
281e41f4b71Sopenharmony_ci**错误码**:
282e41f4b71Sopenharmony_ci
283e41f4b71Sopenharmony_ci以下错误码详细介绍请参考[元能力子系统错误码](errorcode-ability.md)。
284e41f4b71Sopenharmony_ci
285e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 |
286e41f4b71Sopenharmony_ci| ------- | -------- |
287e41f4b71Sopenharmony_ci| 16000050 | Internal error. |
288e41f4b71Sopenharmony_ci
289e41f4b71Sopenharmony_ci**示例:**
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_ci获取当前运行进程的有关信息。使用callback异步回调。
307e41f4b71Sopenharmony_ci
308e41f4b71Sopenharmony_ci> **说明:**
309e41f4b71Sopenharmony_ci>
310e41f4b71Sopenharmony_ci> API version 11之前的版本,该接口需要申请权限ohos.permission.GET_RUNNING_INFO(该权限仅系统应用可申请)。从API version 11开始,该接口不再需要申请权限。
311e41f4b71Sopenharmony_ci
312e41f4b71Sopenharmony_ci**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
313e41f4b71Sopenharmony_ci
314e41f4b71Sopenharmony_ci**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
315e41f4b71Sopenharmony_ci
316e41f4b71Sopenharmony_ci**参数:**
317e41f4b71Sopenharmony_ci
318e41f4b71Sopenharmony_ci  | 参数名 | 类型 | 必填 | 说明 | 
319e41f4b71Sopenharmony_ci  | -------- | -------- | -------- | -------- |
320e41f4b71Sopenharmony_ci  | callback | AsyncCallback\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | 是 |以callback方式返回接口运行结果及有关运行进程的信息,可进行错误处理或其他自定义处理。|
321e41f4b71Sopenharmony_ci
322e41f4b71Sopenharmony_ci**错误码**:
323e41f4b71Sopenharmony_ci
324e41f4b71Sopenharmony_ci以下错误码详细介绍请参考[通用错误码](../errorcode-universal.md)和[元能力子系统错误码](errorcode-ability.md)。
325e41f4b71Sopenharmony_ci
326e41f4b71Sopenharmony_ci| 错误码ID | 错误信息 |
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**示例:**
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