openharmony 鸿蒙 acm-tool

2025-06-12 浏览 (1)

Account Manager

Account Manager (acm) is a tool that provides basic capabilities of managing local accounts, such as creating, deleting, and querying accounts.

NOTE

Before using this tool, you must obtain hdc and run the hdc shell command.

Commands

CommandDescription
helpDisplays the commands supported by acm.
createCreates an account. This command can be used only after the root permission is obtained.
deleteDeletes an account. This command can be used only after the root permission is obtained.
dumpDumps the account information. This command can be used only after the root permission is obtained.
switchSwitches accounts. This command can be used only after the root permission is obtained.
deactivateDeactivates an account. This command can be used only after the root permission is obtained.
setSets constraints for an account. This command can be used only after the root permission is obtained.

help

Usage

acm help

Return Result

Displays the acm help information.

create

Usage

# Display the help information.
acm create -h
# Create an account with a specified name and type.
acm create -n <accountName> -t <accountType> [-s <shortName>] [-l <disallowed-install-hap-list>]

Return Result

If the account is created successfully, "create the local account successfully." is displayed. Otherwise, an error message is displayed.

Parameters of the Create Command

ParameterDescription
-hThis parameter is optional. It is used to display the parameters supported by the create command.
-nThis parameter is mandatory. It specifies the name of a new account.
-tThis parameter is mandatory. It specifies the type of a new account, which can be admin, normal, guest, or private.
-sThis parameter is optional. It specifies the short name of a new account.
-lThis parameter is optional. It specifies the preset application blocklist of a new account.

delete

Usage

# Display the help information.
acm delete -h
# Delete an account with a specified ID.
acm delete -i <accountId>

Return Result

If the account is deleted successfully, "delete the local account successfully." is displayed. Otherwise, an error message is displayed.

Parameters of the Delete Command

ParameterDescription
-hThis parameter is optional. It is used to display the parameters supported by the delete command.
-iThis parameter is mandatory. It specifies the ID of the account to be deleted.

dump

Usage

# Display the help information.
acm dump -h
# Dump the information about all accounts.
acm dump -a
# Dump the information about an account with a specified ID.
acm dump -i <accountId>

Return Result

If the query is successful, the corresponding account information is displayed. Otherwise, an error message is displayed.

Parameters of the Dump Command

ParameterDescription
-hThis parameter is optional. It is used to display the parameters supported by the dump command.
-aThis parameter is mandatory. It is used to dump the information about all accounts.
-iThis parameter is mandatory. It is used to dump the information about an account with a specified ID.

switch

Usage

# Display the help information.
acm switch -h
# Switch to an account with a specified ID.
acm switch -i <accountId>

Return Result

If the account is switched successfully, "switch the local account successfully." is displayed. Otherwise, an error message is displayed.

Parameters of the Switch Command

ParameterDescription
-hThis parameter is optional. It is used to display the parameters supported by the switch command.
-iThis parameter is mandatory. It specifies the ID of an account to be switched to.

deactivate

Usage

# Display the help information.
acm deactivate -h
# Deactivate all accounts.
acm deactivate -a
# Deactivate an account with a specified ID.
acm deactivate -i <accountId>

Return Result

If the account is deactivated successfully, "deactivate the local account successfully." is displayed. Otherwise, an error message is displayed.

Parameters of the Deactivate Command

ParameterDescription
-hThis parameter is optional. It is used to display the parameters supported by the deactivate command.
-aThis parameter is mandatory. It is used to deactivate all accounts.
-iThis parameter is mandatory. It is used to deactivate an account with a specified ID.

set

Usage

# Display the help information.
acm set -h
# Set constraints for an account with a specified ID.
acm set -i <accountId> -c <constraints> [-e]

Return Result

If the constraint is set successfully, "set constraints for the local account successfully." is displayed. Otherwise, an error message is displayed.

Parameters of the Set Command

ParameterDescription
-hThis parameter is optional. It is used to display the parameters supported by the set command.
-iThis parameter is mandatory. It specifies an account ID.
-cThis parameter is mandatory. It specifies the constraints to be set. Each constraint is separated by a comma (,). For details, see Constraints.
-eThis parameter is optional. If this parameter is carried, the command is used to add a constraint; otherwise, the command is used to delete a constraint.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Debugging Tools

harmony 鸿蒙Ability Assistant

harmony 鸿蒙Advanced Notification Manager

harmony 鸿蒙App Check Tool

harmony 鸿蒙Access Token Manager

harmony 鸿蒙Bundle Manager

harmony 鸿蒙Common Event Manager

harmony 鸿蒙devicedebug

harmony 鸿蒙EDM

harmony 鸿蒙LLDB

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/lSVn6T