• 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
22  ```bash
23  aa help
24  ```
25
26
27- start
28
29  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 **exported** tag in the configuration file of the target component cannot be set to **false**.
30
31  | Name| Description|
32  | -------- | -------- |
33  | -h/--help | Help information.|
34  | -d | Device ID. Optional.|
35  | -a | Ability name. Mandatory.|
36  | -b | Bundle name. Mandatory.|
37  | -D | Debugging mode. Optional.|
38
39  **Return value**
40
41  Returns "start ability successfully." if the ability is started; returns "error: failed to start ability." and the corresponding error information otherwise.
42
43  **Method**
44
45
46  ```bash
47  aa start [-d <deviceId>] -a <abilityName> -b <bundleName> [-D]
48  ```
49
50- stop-service
51
52  Stops a ServiceAbility.
53
54  | Name| Description|
55  | -------- | -------- |
56  | -h/--help | Help information.|
57  | -d | Device ID. Optional.|
58  | -a | Ability name. Mandatory.|
59  | -b | Bundle name. Mandatory.|
60
61  **Return value**
62
63  Returns "stop service ability successfully." if the ServiceAbility is stopped; returns "error: failed to stop service ability." otherwise.
64
65  **Method**
66
67
68  ```bash
69  aa stop-service [-d <deviceId>] -a <abilityName> -b <bundleName>
70  ```
71
72- dump
73
74    Prints information about an application component.
75
76    | Name| Level-2 Parameter| Description|
77  | -------- | -------- | -------- |
78  | -h/--help | - | Help information.|
79  | -a/--all | - | Application component information in all missions.|
80  | -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 **multiton** 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.|
81  | -e/--extension | elementName | Extended component information.|
82  | -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**.|
83  | -d/--data | - | DataAbility information.|
84  | -i/--ability | AbilityRecord ID | Detailed information about an application component.|
85  | -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**.|
86
87  **Method**
88
89
90  ```bash
91  aa dump -a
92  ```
93
94  ![aa-dump-a](figures/aa-dump-a.png)
95
96
97  ```bash
98  aa dump -l
99  ```
100
101  ![aa-dump-l](figures/aa-dump-l.png)
102
103
104  ```bash
105  aa dump -i 12
106  ```
107
108  ![aa-dump-i](figures/aa-dump-i.png)
109
110- force-stop
111
112  Forcibly stops a process based on the bundle name.
113
114  **Return value**
115
116  Returns "force stop process successfully." if the process is forcibly stopped; returns "error: failed to force stop process." otherwise.
117
118  **Method**
119
120
121  ```bash
122  aa force-stop <bundleName>
123  ```
124