• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Ability Assistant Usage
2
3The ability assistant enables you to start applications, atomic services, and test cases and debug applications. By using this tool, you can send commands in the hdc shell to perform various system operations, such as starting abilities, forcibly stopping processes, and printing ability information.
4
5## Development Guidelines
6
7The ability assistant is pre-installed in the device environment. You can directly invoke the tool using commands.
8
9### Query-related Commands
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  aa help
23  ```
24
25### Ability-related Commands
26
27- **start**
28
29  Starts an ability.
30
31  | Name     | Description                  |
32  | --------- | -------------------------- |
33  | -h/--help | Help information.                |
34  | -d        | Device ID. This parameter is optional.   |
35  | -a        | Ability name. This parameter is mandatory.|
36  | -b        | Bundle name. This parameter is mandatory. |
37  | -D        | Debugging mode. This parameter is optional.      |
38
39  **Return value**
40
41  Returns "start ability successfully." if the ability is started; returns "error: failed to start ability." otherwise.
42
43  **Method**
44
45  ```
46  aa start [-d <device-id>] -a <ability-name> -b <bundle-name> [-D]
47  ```
48
49- **stop-service**
50
51  Stops a Service ability.
52
53  | Name     | Description                |
54  | --------- | ------------------------ |
55  | -h/--help | Help information.              |
56  | -d        | Device ID. This parameter is optional.   |
57  | -a        | Ability name. This parameter is mandatory.|
58  | -b        | Bundle name. This parameter is mandatory. |
59
60  **Return value**
61
62  Returns "stop service ability successfully." if the Service ability is stopped; returns "error: failed to stop service ability." otherwise.
63
64  **Method**
65
66  ```
67  aa stop-service [-d <device-id>] -a <ability-name> -b <bundle-name>
68  ```
69
70- **dump**
71
72  Prints ability-related information.
73
74  | Name             | Level-2 Parameter            | Description                                                    |
75  | ----------------- | -------------------- | ------------------------------------------------------------ |
76  | -h/--help         | -                    | Prints help information.                                                  |
77  | -a/--all          | -                    | Prints ability information in all missions.                                |
78  | -l/--mission-list | type (All logs are printed if this parameter is left unspecified.)| Prints mission stack information.<br>The following values are available for **type**:<br>- NORMAL <br>- DEFAULT_STANDARD<br>- DEFAULT_SINGLE<br>- LAUNCHER |
79  | -e/--extension    | elementName          | Prints extended component information.                                          |
80  | -u/--userId       | UserId               | Prints stack information of a specified user ID. This parameter must be used together with other parameters.<br>Example commands: aa **dump -a -u 100** and **aa dump -d -u 100**|
81  | -d/--data         | - | Prints Data ability information.                                          |
82  | -i/--ability      | AbilityRecord ID     | Prints detailed information about a specified ability.                                     |
83  | -c/--client       | - | Prints detailed ability information. This parameter must be used together with other parameters.<br>Example commands: **aa dump -a -c** and **aa dump -i 21 -c**|
84
85  **Method**
86
87  ```
88  aa dump -a
89  ```
90  ![aa-dump-a](figures/aa-dump-a.PNG)
91  ```
92  aa dump -l
93  ```
94  ![aa-dump-l](figures/aa-dump-l.PNG)
95  ```
96  aa dump -i 12
97  ```
98  ![aa-dump-i](figures/aa-dump-i.PNG)
99- **force-stop**
100
101  Forcibly stops a process based on the bundle name.
102
103  **Return value**
104
105  Returns "force stop process successfully." if the process is forcibly stopped; returns "error: failed to force stop process." otherwise.
106
107  **Method**
108
109  ```
110  aa force-stop <bundle-name>
111  ```
112