# EDM Enterprise 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. ## Environment Setup Before using this tool, you must obtain the [hdc tool](../../device-dev/subsystems/subsys-toolchain-hdc-guide.md) and run the **hdc shell** command. ## edm Commands | Command | Description | | ------------- | ------------------------------------------------------------ | | help | Displays the commands supported by the edm tool. | | enable-admin | Enables the extended enterprise device management capabilities of a component. The target component must be an [EnterpriseAdminExtensionAbility](../mdm/mdm-kit-admin.md).| | disable-admin | Disables the extended enterprise device management capabilities of a component. | ## help ```bash # Display the help information. edm help ``` ## enable-admin ```bash edm enable-admin [-h] [-n bundleName] [-a abilityName] ``` **Parameters in the enable-admin command** | Parameter | Description | | ----------------- | ----------------------- | | -h/--help | Help information. | | -n/--bundle-name | Bundle name. This parameter is mandatory. | | -a/--ability-name | Ability name. This parameter is mandatory.| **Example** ```bash # Enable the EnterpriseAdminExtensionAbility whose bundle name is com.example.mdmsample and class name is EnterpriseAdminAbility. edm enable-admin -n com.example.mdmsample -a com.example.mdmsample.EnterpriseAdminAbility // The execution result is as follows: enable-admin success. ``` ## disable-admin ```bash edm disable-admin [-h] [-n bundleName] ``` **Parameters in the disable-admin command** | Parameter | Description | | ---------------- | ---------------------- | | -h/--help | Help information. | | -n/--bundle-name | Bundle name. This parameter is mandatory.| **Example** ```bash # Disable the EnterpriseAdminExtensionAbility whose bundle name is com.example.mdmsample. edm disable-admin -n com.example.mdmsample // The execution result is as follows: disable-admin success. ``` ## Error Messages ### error: command requires option. **Symptom** **bundleName** and **abilityName** are not passed in. **Possible Causes** **bundleName** and **abilityName** are not passed in. **Solution** 1. If the **enable-admin** command is used, add the **-n \** and **-a \** parameters. 2. If the **disable-admin** command is used, add the **-n \** parameter. ### error: -n, --bundle-name option requires an argument. **Symptom** The input value of **bundleName** is empty. **Possible Causes** The input value of **bundleName** is empty. **Solution** Check the parameters following **-n** and add **bundleName**. ### error: -a, --ability-name option requires an argument. **Symptom** The input value of **abilityName** is empty. **Possible Causes** The input value of **abilityName** is empty. **Solution** Check the parameters following **-a** and add **abilityName**. ### error: unknown option. **Symptom** An unknown parameter is passed in. **Possible Causes** An unknown parameter is passed in. **Solution** Check whether the parameter is in the parameter list. ### error: -n \ is expected. **Symptom** **bundleName** is not passed in. **Possible Causes** **bundleName** is not passed in. **Solution** Add **-n \** to the command. ### error: -a \ is expected. **Symptom** **abilityName** is not passed in. **Possible Causes** **abilityName** is not passed in. **Solution** Add **-a \** to the command. ### error: the administrator ability component is invalid. **Symptom** The input value of **bundleName** or **abilityName** is incorrect, or the component is not an EnterpriseAdminExtensionAbility. **Possible Causes** 1. The bundleName is incorrect. 2. The input abilityName is incorrect. 3. The component is not an **EnterpriseAdminExtensionAbility**. **Solution** Obtain the **bundleName** of the application and the **abilityName** of the **EnterpriseAdminExtensionAbility**, and pass them to the parameter. ### error: failed to enable the administrator application of the device. **Symptom** The component fails to be enabled. **Possible Causes** 1. The bundleName is incorrect. 2. The component is not an **EnterpriseAdminExtensionAbility**. 3. An activated **EnterpriseAdminExtensionAbility** exists. **Solution** 1. Obtain the **bundleName** of the application and the **abilityName** of the **EnterpriseAdminExtensionAbility**, and pass them to the parameter. 2. Use an uncontrolled device for debugging. ### error: failed to disable the administrator application of the device. **Symptom** The component fails to be disabled. **Possible Causes** 1. The component is not activated. 2. The component is not activated by running the hdc command. 3. The deactivation fails. **Solution** Obtain the **bundleName** of the application that can be deactivated by the hdc command and pass the **bundleName** to the parameter.