Since version 6.1.0 Release, Command Line Tools integrates the Emulator, supporting Windows and macOS platforms for independent emulator operations such as emulator creation, startup, shutdown, and image download.
Since version 26.0.0, the Emulator is available on the Linux platform. For details, see Using the Emulator on Linux.
To use Command Line Tools on macOS, if a dialog prompts that the Emulator cannot be verified by the developer check, you can go to Settings > Privacy & Security and select Open Anyway for the Emulator, or use the Emulator under the DevEco Studio directory.
The Emulator is located in the emulator directory under the command-line-tools installation directory. You can run commands in either of the following ways:
Add the path {command-line-tools installation directory}/emulator to the system or user PATH variable. After the configuration is complete, open the CLI window again for the environment variable to take effect.
Open the CLI terminal and run the following command:
export PATH={command-line-tools installation directory}/emulator:$PATH You can use the hdc tool to push packages and debug on the emulator.
hdc list targets
hdc tconn 127.0.0.1:5555
Currently, only Ubuntu 18.04 and later versions are supported. Before using the Emulator, install the required dependencies. For example, if you are using Ubuntu 18.04, run the following command:
apt install -y libatomic1 libpulse0 libegl1 libgbm1 libgl1 libpng16-16 libfontconfig1 libfreetype6 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xinerama0 libxcb-xkb1 libsm6 libice6 libxkbcommon-x11-0 libxkbcommon0 libglib2.0-0
For the Linux environment without a GUI, the command for starting the emulator must contain the -noWindow parameter. Other commands are the same as those for Windows and macOS. For details, see Using the Emulator via the CLI.