1# EDM
2
3Enterprise Device Manager (edm) provides debugging and testing capabilities for device management applications. For example, it can be used to enable or disable extended enterprise device management capabilities.
4
5## Environment Setup
6
7Before using this tool, you must obtain the <!--Del-->[<!--DelEnd-->hdc tool<!--Del-->](../../device-dev/subsystems/subsys-toolchain-hdc-guide.md)<!--DelEnd--> and run the **hdc shell** command.
8
9## edm Commands
10
11| Command         | Description                                                        |
12| ------------- | ------------------------------------------------------------ |
13| help          | Displays the commands supported by the edm tool.                       |
14| enable-admin  | Enables the extended enterprise device management capabilities of a component. The target component must be an [EnterpriseAdminExtensionAbility](../mdm/mdm-kit-admin.md).|
15| disable-admin | Disables the extended enterprise device management capabilities of a component.            |
16
17## help
18
19
20  ```bash
21# Display the help information.
22edm help
23  ```
24
25## enable-admin
26
27
28  ```bash
29edm enable-admin [-h] [-n bundleName] [-a abilityName]
30  ```
31
32**Parameters in the enable-admin command**
33
34| Parameter             | Description               |
35| ----------------- | ----------------------- |
36| -h/--help         | Help information.             |
37| -n/--bundle-name  | Bundle name. This parameter is mandatory. |
38| -a/--ability-name | Ability name. This parameter is mandatory.|
39
40 **Example**
41
42```bash
43# Enable the EnterpriseAdminExtensionAbility whose bundle name is com.example.mdmsample and class name is EnterpriseAdminAbility.
44edm enable-admin -n com.example.mdmsample -a com.example.mdmsample.EnterpriseAdminAbility
45// The execution result is as follows:
46enable-admin success.
47```
48
49
50## disable-admin
51
52  ```bash
53edm disable-admin [-h] [-n bundleName]
54  ```
55
56**Parameters in the disable-admin command**
57
58| Parameter            | Description              |
59| ---------------- | ---------------------- |
60| -h/--help        | Help information.            |
61| -n/--bundle-name | Bundle name. This parameter is mandatory.|
62
63  **Example**
64
65
66  ```bash
67# Disable the EnterpriseAdminExtensionAbility whose bundle name is com.example.mdmsample.
68edm disable-admin -n com.example.mdmsample
69// The execution result is as follows:
70disable-admin success.
71  ```
72
73## Error Messages
74
75### error: command requires option.
76
77**Symptom**
78
79**bundleName** and **abilityName** are not passed in.
80
81**Possible Causes**
82
83**bundleName** and **abilityName** are not passed in.
84
85**Solution**
86
871. If the **enable-admin** command is used, add the **-n \<bundle-name\>** and **-a \<ability-name\>** parameters.
88
892. If the **disable-admin** command is used, add the **-n \<bundle-name\>** parameter.
90
91### error: -n, --bundle-name option requires an argument.
92
93**Symptom**
94
95The input value of **bundleName** is empty.
96
97**Possible Causes**
98
99The input value of **bundleName** is empty.
100
101**Solution**
102
103Check the parameters following **-n** and add **bundleName**.
104
105### error: -a, --ability-name option requires an argument.
106
107**Symptom**
108
109 The input value of **abilityName** is empty.
110
111**Possible Causes**
112
113 The input value of **abilityName** is empty.
114
115**Solution**
116
117Check the parameters following **-a** and add **abilityName**.
118
119### error: unknown option.
120
121**Symptom**
122
123 An unknown parameter is passed in.
124
125**Possible Causes**
126
127 An unknown parameter is passed in.
128
129**Solution**
130
131Check whether the parameter is in the parameter list.
132
133### error: -n \<bundle-name\> is expected.
134
135**Symptom**
136
137**bundleName** is not passed in.
138
139**Possible Causes**
140
141**bundleName** is not passed in.
142
143**Solution**
144
145Add **-n \<bundle-name\>** to the command.
146
147### error: -a \<ability-name\> is expected.
148
149**Symptom**
150
151**abilityName** is not passed in.
152
153**Possible Causes**
154
155**abilityName** is not passed in.
156
157**Solution**
158
159Add **-a \<ability-name\>** to the command.
160
161### error: the administrator ability component is invalid.
162
163**Symptom**
164
165The input value of **bundleName** or **abilityName** is incorrect, or the component is not an EnterpriseAdminExtensionAbility.
166
167**Possible Causes**
168
1691. The bundleName is incorrect.
170
1712. The input abilityName is incorrect.
172
1733. The component is not an **EnterpriseAdminExtensionAbility**.
174
175**Solution**
176
177Obtain the **bundleName** of the application and the **abilityName** of the **EnterpriseAdminExtensionAbility**, and pass them to the parameter.
178
179### error: failed to enable the administrator application of the device.
180
181**Symptom**
182
183The component fails to be enabled.
184
185**Possible Causes**
186
1871. The bundleName is incorrect.
188
1892. The component is not an **EnterpriseAdminExtensionAbility**.
190
1913. An activated **EnterpriseAdminExtensionAbility** exists.
192
193**Solution**
194
1951. Obtain the **bundleName** of the application and the **abilityName** of the **EnterpriseAdminExtensionAbility**, and pass them to the parameter.
196
1972. Use an uncontrolled device for debugging.
198
199### error: failed to disable the administrator application of the device.
200
201**Symptom**
202
203The component fails to be disabled.
204
205**Possible Causes**
206
2071. The component is not activated.
208
2092. The component is not activated by running the hdc command.
210
2113. The deactivation fails.
212
213**Solution**
214
215Obtain the **bundleName** of the application that can be deactivated by the hdc command and pass the **bundleName** to the parameter.
216