harmony 鸿蒙EDM
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 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. |
disable-admin | Disables the extended enterprise device management capabilities of a component. |
help Command
# Display the help information.
edm help
enable-admin Command
# Display the help information.
edm enable-admin -h
# Enable the extended enterprise device management capabilities.
edm enable-admin -n <bundleName> -a <abilityName> [-t <adminType>]
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. |
-t/–admin-type | Admin type. This parameter is optional. The value can be: super: a super device management application. byod: a BYOD device management application. The default value is super. |
Example
# 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
# Execution result.
enable-admin success.
disable-admin Command
# Display the help information.
edm disable-admin -h
# Disable the extended enterprise device management capabilities.
edm disable-admin -n <bundleName>
Parameters in the disable-admin command
Parameter | Description |
---|---|
-h/–help | Help information. |
-n/–bundle-name | Bundle name. This parameter is mandatory. |
Example
# Disable the EnterpriseAdminExtensionAbility whose bundle name is com.example.mdmsample.
edm disable-admin -n com.example.mdmsample
# Execution result.
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
If the enable-admin command is used, add the -n <bundle-name> and -a <ability-name> parameters.
If the disable-admin command is used, add the -n <bundle-name> 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 <bundle-name> is expected
Symptom
bundleName is not passed in.
Possible Causes
bundleName is not passed in.
Solution
Add -n <bundle-name> to the command.
error: -a <ability-name> is expected
Symptom
abilityName is not passed in.
Possible Causes
abilityName is not passed in.
Solution
Add -a <ability-name> 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
The bundleName is incorrect.
The input abilityName is incorrect.
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
The bundleName is incorrect.
The component is not an EnterpriseAdminExtensionAbility.
An activated EnterpriseAdminExtensionAbility exists.
Solution
Obtain the bundleName of the application and the abilityName of the EnterpriseAdminExtensionAbility, and pass them to the parameter.
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
The component is not activated.
The component is not activated by running the hdc command.
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.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Advanced Notification Manager
harmony 鸿蒙Access Token Manager
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦