• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Ability Assistant
2
3
4The ability assistant enables you to start applications and test cases. It provides basic application debugging and testing capabilities, for example, starting application components, forcibly stopping processes, and printing application component information.
5
6> **NOTE**
7>
8> Before using this tool, you must obtain the [hdc tool](../../device-dev/subsystems/subsys-toolchain-hdc-guide.md) and run the hdc shell command.
9
10
11- help
12
13  Displays help information for the Ability Assistant.
14
15  **Return value**
16
17  Returns the help information.
18
19  **Method**
20
21    ```bash
22    aa help
23    ```
24
25
26- start
27
28  Starts an application component. The target component can be the PageAbility and ServiceAbility components of the FA model or the UIAbility and ServiceExtensionAbility components of the Stage model. The **visible** tag in the configuration file of the target component cannot be set to **false**.
29
30  | Name| Description|
31  | -------- | -------- |
32  | -h/--help | Help information.|
33  | -d | Device ID. Optional.|
34  | -a | Ability name. Mandatory.|
35  | -b | Bundle name. Mandatory.|
36  | -D | Debugging mode. Optional.|
37
38  **Return value**
39
40  Returns "start ability successfully." if the ability is started; returns "error: failed to start ability." and the corresponding error information otherwise.
41
42  **Method**
43
44    ```bash
45    aa start [-d <deviceId>] -a <abilityName> -b <bundleName> [-D]
46    ```
47
48- stop-service
49
50  Stops a ServiceAbility.
51
52  | Name| Description|
53  | -------- | -------- |
54  | -h/--help | Help information.|
55  | -d | Device ID. Optional.|
56  | -a | Ability name. Mandatory.|
57  | -b | Bundle name. Mandatory.|
58
59  **Return value**
60
61  Returns "stop service ability successfully." if the ServiceAbility is stopped; returns "error: failed to stop service ability." otherwise.
62
63  **Method**
64
65    ```bash
66    aa stop-service [-d <deviceId>] -a <abilityName> -b <bundleName>
67    ```
68
69- dump
70
71  Prints information about an application component.
72
73  | Name| Level-2 Parameter| Description|
74  | -------- | -------- | -------- |
75  | -h/--help | - | Help information.|
76  | -a/--all | - | Application component information in all missions.|
77  | -l/--mission-list | type (All logs are printed if this parameter is left unspecified.)| For better management, the service side maintains four types of MissionLists, as described below:<br>- **NORMAL**: MissionList that is started normally. For example, if A starts B and C, the corresponding MissionList is A->B->C.<br>- **DEFAULT_STANDARD**: If a MissionList is damaged, missions with the launch type set to **standard** are removed to this MissionList. The Missions in it are not associated with each other.<br>- **DEFAULT_SINGLE**: If a MissionList is damaged, missions with the launch type set to **singleton** are removed to this MissionList. The Missions in it are not associated with each other.<br>- **LAUNCHER**: MissionList for launcher abilities. |
78  | -e/--extension | elementName | Extended component information.|
79  | -u/--userId | UserId | Mission stack information of a specified user ID. This parameter must be used together with other parameters. Example commands: **aa dump -a -u 100** and **aa dump -d -u 100**.|
80  | -d/--data | - | DataAbility information.|
81  | -i/--ability | AbilityRecord ID | Detailed information about an application component.|
82  | -c/--client | - | Detailed information about an application component. This parameter must be used together with other parameters. Example commands: **aa dump -a -c** and **aa dump -i 21 -c**.|
83
84  **Method**
85
86    ```bash
87  aa dump -a
88    ```
89
90    ![aa-dump-a](figures/aa-dump-a.png)
91
92
93    ```bash
94  aa dump -l
95    ```
96
97    ![aa-dump-l](figures/aa-dump-l.png)
98
99
100    ```bash
101  aa dump -i 12
102    ```
103
104      ![aa-dump-i](figures/aa-dump-i.png)
105
106- force-stop
107
108  Forcibly stops a process based on the bundle name.
109
110  **Return value**
111
112  Returns "force stop process successfully." if the process is forcibly stopped; returns "error: failed to force stop process." otherwise.
113
114  **Method**
115
116    ```bash
117    aa force-stop <bundleName>
118    ```
119