• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 Command
18
19
20  ```bash
21# Display the help information.
22edm help
23  ```
24
25## enable-admin Command
26
27
28  ```bash
29# Display the help information.
30edm enable-admin -h
31# Enable the extended enterprise device management capabilities.
32edm enable-admin -n <bundleName> -a <abilityName> [-t <adminType>]
33  ```
34
35**Parameters in the enable-admin command**
36
37| Parameter             | Description                                                    |
38| ----------------- | ------------------------------------------------------------ |
39| -h/--help         | Help information.                                                  |
40| -n/--bundle-name  | Bundle name. This parameter is mandatory.                                      |
41| -a/--ability-name | Ability name. This parameter is mandatory.                                     |
42| -t/--admin-type   | Admin type. This parameter is optional.<br>The value can be:<br>**super**: a super device management application.<br>**byod**: a BYOD device management application.<br>The default value is **super**.|
43
44 **Example**
45
46```bash
47# Enable the EnterpriseAdminExtensionAbility whose bundle name is com.example.mdmsample and class name is EnterpriseAdminAbility.
48edm enable-admin -n com.example.mdmsample -a com.example.mdmsample.EnterpriseAdminAbility
49# Execution result.
50enable-admin success.
51```
52
53
54## disable-admin Command
55
56  ```bash
57# Display the help information.
58edm disable-admin -h
59# Disable the extended enterprise device management capabilities.
60edm disable-admin -n <bundleName>
61  ```
62
63**Parameters in the disable-admin command**
64
65| Parameter            | Description              |
66| ---------------- | ---------------------- |
67| -h/--help        | Help information.            |
68| -n/--bundle-name | Bundle name. This parameter is mandatory.|
69
70  **Example**
71
72
73  ```bash
74# Disable the EnterpriseAdminExtensionAbility whose bundle name is com.example.mdmsample.
75edm disable-admin -n com.example.mdmsample
76# Execution result.
77disable-admin success.
78  ```
79
80## Error Messages
81
82### error: command requires option
83
84**Symptom**
85
86**bundleName** and **abilityName** are not passed in.
87
88**Possible Causes**
89
90**bundleName** and **abilityName** are not passed in.
91
92**Solution**
93
941. If the **enable-admin** command is used, add the **-n \<bundle-name\>** and **-a \<ability-name\>** parameters.
95
962. If the **disable-admin** command is used, add the **-n \<bundle-name\>** parameter.
97
98### error: -n, --bundle-name option requires an argument
99
100**Symptom**
101
102The input value of **bundleName** is empty.
103
104**Possible Causes**
105
106The input value of **bundleName** is empty.
107
108**Solution**
109
110Check the parameters following **-n** and add **bundleName**.
111
112### error: -a, --ability-name option requires an argument
113
114**Symptom**
115
116 The input value of **abilityName** is empty.
117
118**Possible Causes**
119
120 The input value of **abilityName** is empty.
121
122**Solution**
123
124Check the parameters following **-a** and add **abilityName**.
125
126### error: unknown option
127
128**Symptom**
129
130 An unknown parameter is passed in.
131
132**Possible Causes**
133
134 An unknown parameter is passed in.
135
136**Solution**
137
138Check whether the parameter is in the parameter list.
139
140### error: -n \<bundle-name\> is expected
141
142**Symptom**
143
144**bundleName** is not passed in.
145
146**Possible Causes**
147
148**bundleName** is not passed in.
149
150**Solution**
151
152Add **-n \<bundle-name\>** to the command.
153
154### error: -a \<ability-name\> is expected
155
156**Symptom**
157
158**abilityName** is not passed in.
159
160**Possible Causes**
161
162**abilityName** is not passed in.
163
164**Solution**
165
166Add **-a \<ability-name\>** to the command.
167
168### error: the administrator ability component is invalid
169
170**Symptom**
171
172The input value of **bundleName** or **abilityName** is incorrect, or the component is not an EnterpriseAdminExtensionAbility.
173
174**Possible Causes**
175
1761. The bundleName is incorrect.
177
1782. The input abilityName is incorrect.
179
1803. The component is not an **EnterpriseAdminExtensionAbility**.
181
182**Solution**
183
184Obtain the **bundleName** of the application and the **abilityName** of the **EnterpriseAdminExtensionAbility**, and pass them to the parameter.
185
186### error: failed to enable the administrator application of the device
187
188**Symptom**
189
190The component fails to be enabled.
191
192**Possible Causes**
193
1941. The bundleName is incorrect.
195
1962. The component is not an **EnterpriseAdminExtensionAbility**.
197
1983. An activated **EnterpriseAdminExtensionAbility** exists.
199
200**Solution**
201
2021. Obtain the **bundleName** of the application and the **abilityName** of the **EnterpriseAdminExtensionAbility**, and pass them to the parameter.
203
2042. Use an uncontrolled device for debugging.
205
206### error: failed to disable the administrator application of the device
207
208**Symptom**
209
210The component fails to be disabled.
211
212**Possible Causes**
213
2141. The component is not activated.
215
2162. The component is not activated by running the hdc command.
217
2183. The deactivation fails.
219
220**Solution**
221
222Obtain the **bundleName** of the application that can be deactivated by the hdc command and pass the **bundleName** to the parameter.
223