• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RunningAppClone (System API)
2
3The RunningAppClone module defines the information of an application clone in the running state.
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 12. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8>
9> The APIs provided by this module are system APIs.
10
11## How to Use
12
13The RunningAppClone struct is obtained from [getRunningMultiAppInfo](js-apis-app-ability-appManager-sys.md#appmanagergetrunningmultiappinfo12) of **appManager**.
14
15## RunningAppClone
16
17**System API**: This is a system API.
18
19**System capability**: SystemCapability.Ability.AbilityRuntime.Core
20
21| Name                     | Type  | Read-Only | Optional | Description      |
22| ------------------------- | ------ | ---- |  ---- | --------- |
23| appCloneIndex | number | No | No | Index of an application clone.|
24| uid | number | No | No | UID of the application.|
25| pids | Array\<number> | No | No | Process ID set of the application.|
26
27**Example**
28
29```ts
30import { appManager } from '@kit.AbilityKit';
31import { hilog } from '@kit.PerformanceAnalysisKit';
32import { BusinessError } from '@kit.BasicServicesKit';
33
34try {
35  let bundleName: string = 'ohos.samples.etsclock';
36  appManager.getRunningMultiAppInfo(bundleName).then((info: appManager.RunningMultiAppInfo) => {
37      hilog.info(0x0000, 'testTag', `getRunningMultiAppInfo success`);
38    }).catch((err: BusinessError) => {
39      hilog.error(0x0000, 'testTag', `getRunningMultiAppInfo error, code: ${err.code}, msg:${err.message}`);
40    })
41} catch (err) {
42  hilog.error(0x0000, 'testTag', `getRunningMultiAppInfo error, code: ${err.code}, msg:${err.message}`);
43}
44```
45