目录

Using the Emulator via the CLI

In addition to using the Emulator in the device management module of DevEco Studio, you can also use it via the Emulator command-line tool on Windows, macOS, and Linux. For details about how to use the Emulator on Linux, see Emulator.

Environment Setup

The Emulator command-line tool is located in the tools/emulator directory under the DevEco Studio installation path, or the emulator directory under the Command Line Tools installation path. The following uses DevEco Studio as an example. There are two ways to run commands:

  • If the emulator name or path contains special characters or spaces, add quotation marks ("") to the name or path.
  • The following commands use the Windows environment as an example. If the commands are executed on macOS and environment variables are not configured, add ./ before Emulator, for example, ./Emulator -help.
  • Since DevEco Studio 6.1.0 Beta1, command-line parameters are case-insensitive. For example, the -list parameter can be written as -list or -LIST.

Getting Help

# Display all executable commands.
Emulator -help

Since version 26.0.0, you can use the -help command in combination with other executable commands to query the detailed description of the corresponding command.

# Display the detailed description of a specified command, for example, -create.
Emulator -help -create

Querying an Image

Since DevEco Studio 6.1.0 Beta1, querying emulator images is supported.

Emulator -imageList -deviceType {Emulator type} -downloaded {true/false} -http_proxy {Network proxy}

Parameters

Name

Description

-imageList

(Mandatory) Flag to query all images of release versions.

-deviceType

(Optional) Images of a specified product type to query. The value is case-insensitive. For details about the supported product types, see Supported Devices.

-downloaded

(Optional) Images that have been downloaded or not downloaded to query.

-http_proxy

(Optional) Proxy for querying images when the network is restricted.

Proxy format: {Proxy protocol}://{User name}:{Password}@{Proxy host name}:{Port number}. The proxy protocol can be HTTP or HTTPS. If the password contains special characters, the characters must be escaped.

Returns

Return

Description

SoftWareVersion

Detailed image version number, which can be used to specify the -osVersion parameter during image downloading.

deviceType

Product type of the emulator, which can be used to specify the -deviceType parameter during image downloading.

downloaded

Whether the image has been downloaded locally. The value is true or false.

osVersion

Image version number, which can be used to specify the -osVersion parameter during image downloading.

releaseType

Release type of the image.

upgradable

Whether a newer version of the image is available compared with the local image. The value is true or false.

$ Emulator -imageList -deviceType phone -downloaded false -http_proxy "http://user:password@proxy.proxyserver.com:port"
[
    {
        "SoftWareVersion": "6.0.0.112",
        "deviceType": "phone",
        "downloaded": "false",
        "osVersion": "HarmonyOS 6.0.1(21)",
        "releaseType": "Release",
        "upgradable": "false"
    },
    ...
]

Downloading an Image

Since DevEco Studio 6.1.0 Beta1, downloading emulator images is supported. Currently, this feature is available only in the Chinese mainland.

Emulator -install -deviceType {Emulator type} -osVersion {Emulator image version} -imageRoot {Image path} -http_proxy {Network proxy} -force

Parameters

Name

Description

-install

(Mandatory) Flag to download the image. You must agree to the HarmonyOS SDK license agreement upon the first use.

-deviceType

(Mandatory) Type of the product to be downloaded. You can obtain the value of deviceType when querying the image. The value is case-insensitive.

-osVersion

(Mandatory) Version of the image to be downloaded. You can obtain the version number from SoftWareVersion or osVersion returned when querying the image.

-imageRoot

(Optional) Path for downloading the emulator image. If this parameter is not specified, the emulator image path in DevEco Studio is used by default.

-http_proxy

(Optional) Proxy for downloading images when the network is restricted.

Proxy format: {Proxy protocol}://{User name}:{Password}@{Proxy host name}:{Port number}. The proxy protocol can be HTTP or HTTPS. If the password contains special characters, the characters must be escaped.

-force

(Optional) Flag to force download or update of the specified image version. When the target image already exists, an interactive confirmation (y/n) is required. Appending this parameter bypasses the confirmation.

Example

Emulator -install -deviceType phone -osVersion "HarmonyOS 6.0.1(21)" -imageRoot D:\Sdk -http_proxy "http://user:password@proxy.proxyserver.com:port" -force

Deleting an Image

Since DevEco Studio 6.1.0 Beta1, deleting emulator images is supported.

Emulator -uninstall -deviceType {Emulator type} -osVersion {Emulator image version} -imageRoot {Image path} -force

Parameters

Name

Description

-uninstall

(Mandatory) Flag to delete the image.

-deviceType

(Mandatory) Type of the product to be deleted, which is case-insensitive and must be the same as the value of -deviceType for downloading the image.

-osVersion

(Mandatory) Version of the image to be deleted, which must be the same as the value of -osVersion for downloading the image.

-imageRoot

(Optional) Path of the image to be deleted. If this parameter is not specified, the emulator image path in DevEco Studio is used by default.

-force

(Optional) Flag to force deletion of the specified image version. When the target image exists, an interactive confirmation (y/n) is required. Appending this parameter bypasses the confirmation.

Example

Emulator -uninstall -deviceType phone -osVersion "HarmonyOS 6.0.1(21)" -imageRoot D:\Sdk -force

Creating an Emulator

Since DevEco Studio 6.1.0 Beta1, creating emulators is supported.

Emulator -create {Emulator name} -deviceType {Emulator type} -osVersion {Emulator image version} -instancePath {Emulator instance path} -imageRoot {Emulator image path} -screenProfile {Standard emulator model} -screen {Emulator screen parameters} -storage {Emulator storage space} -memory {Emulator RAM} -hotBoot {true/false}

Parameters

Name

Description

-create

(Mandatory) Emulator name.

-deviceType

(Mandatory) Emulator product type. For details about the supported product types, see Supported Devices. The value is case insensitive.

-osVersion

(Mandatory) Emulator image version.

For a release version, the value is the same as the value of the -osVersion parameter for downloading the image, for example, "HarmonyOS 6.0.1(21)". For a non-release version, the version can be obtained when the emulator is created in DevEco Studio, for example, "HarmonyOS 6.0.2(22) Beta1".

-instancePath/-path

(Optional) Emulator instance path. If this parameter is not specified, the emulator instance path in DevEco Studio is used by default.

-imageRoot

(Optional) Emulator image path. If this parameter is not specified, the emulator image path in DevEco Studio is used by default.

-screenProfile

(Optional) Device model of the emulator, for example, "Mate 70 Pro". You can run the screenProfileList command to query the supported device models. If this parameter is not specified, the latest device model of the current product type is used by default.

If the -screen parameter is also set, the -screen parameter takes precedence.

This parameter is available only for emulators that support custom screens. For details, see Customizing the Virtual Device Screen.

-screen

(Optional) Custom screen configuration of the emulator, including screen width, height, DPI, and diagonal length. The format is "width(px) height(px) DPI diagonal(inch)", for example, -screen "1316 2832 560 6.9".

For a bi-fold emulator, two sets of screen parameters are required, corresponding to the unfolded and folded screens, for example, -screen "2200 2480 480 7.8" "1080 2480 480 6.4".

This parameter is available only for emulators that support custom screens. For details, see Customizing the Virtual Device Screen.

-storage

(Optional) Storage space of the emulator. The value ranges from 2 to 1023 (unit: GB). The default value is 6 GB.

For 26.0.0 and later versions, the value ranges from 2 to 100 (unit: GB).

-memory

(Optional) RAM of the emulator. The value ranges from 2 to 32 (unit: GB). The default value is 4 GB.

-hotBoot

(Optional) Whether to enable the hot start function of the emulator. The value can be true or false. If this parameter is not specified, the default value false is used. When it is set to true, the snapshot saved at the last shutdown is loaded during startup, and the emulator is restored to its previous state after startup. This parameter is supported since version 26.0.0.

Example

Emulator -create Mate70Pro -deviceType phone -osVersion "HarmonyOS 6.0.1(21)" -instancePath D:\Emulator -imageRoot D:\Sdk -screenProfile "Mate 70 Pro" -storage 8 -memory 16

Deleting an Emulator

Since DevEco Studio 6.1.0 Beta1, deleting emulator instances is supported. Note that images are not deleted.

Emulator -delete {Emulator name} -instancePath {Emulator instance path} -force

Parameters

Name

Description

-delete

(Mandatory) Emulator name.

-instancePath/-path

(Optional) Emulator instance path. If this parameter is not specified, the emulator instance path in DevEco Studio is used by default.

-force

(Optional) Flag to force deletion of the specified emulator instance. An interactive confirmation (y/n) is required. Appending this parameter bypasses the confirmation.

Example

Emulator -delete Mate70Pro -instancePath D:\Emulator -force

Viewing Emulator Instances

Since DevEco Studio 6.0.0 Beta3, viewing emulator instances is supported.

Emulator -list -details

Parameters

Name

Description

-list

(Mandatory) Flag to query the list of local emulator instances.

-details

(Optional) Flag to query the details about a local emulator instance, including the emulator version, image path, and instance path. The following table lists common returned fields. This parameter is supported since DevEco Studio 6.0.2 Beta1.

Returns

Return

Description

name

Emulator name.

deviceType

Product type of the emulator.

deviceModel

Product model of the emulator.

productModel

Specific product model of the emulator.

vendorCountry

Country/Region code.

uuid

Emulator UUID.

isHotBoot

Whether hot boot is enabled.

isCustomize

Whether the current emulator has a custom screen configuration.

isRunning

Whether the current emulator is running.

configPath

Configuration directory for the emulator.

logPath

Log directory for the emulator.

sdkPath

Path to the SDK used by the emulator.

imageRoot

Emulator image download path.

imageSubPath

Subfolder path of the emulator image. The absolute image path is imageRoot + imageSubPath.

instancePath

Emulator instance path.

os.osVersion

Version number of the emulator image.

os.apiVersion

API version of the emulator image.

os.softwareVersion

Specific version number of the emulator image.

os.isPublic

Whether the emulator is a public version.

hw.cpu.arch

CPU architecture type of the emulator.

hw.cpu.ncore

Number of CPU cores of the emulator.

hw.lcd.density

Emulator DPI.

hw.lcd.phy.height/width

Physical dimensions of the device model corresponding to the emulator.

hw.lcd.number

Number of screen states of the device model corresponding to the emulator (for example, a foldable device has folded and unfolded states).

hw.lcd.single.diagonalSize/height/width

Single-screen size and resolution of the emulator.

hw.lcd.double.diagonalSize/height/width

Dual-screen size and resolution of the emulator (for foldables).

hw.lcd.triple.diagonalSize/height/width

Triple-screen size and resolution of the emulator (for tri-fold phones).

hw.ramSize

RAM size of the emulator.

hw.dataPartitionSize

Storage space size of the emulator.

hw.lcd.single/double.CutoutPath

Cutout parameters for the emulator.

hw.hdc.port

HDC port number.

Starting the Emulator

Emulator -start {Emulator name} -path {Emulator instance path} -imageRoot {Emulator image path} -hdcport {HDC port number} -bootMode {Boot mode} -noWindow

Parameters

Name

Description

-hvd/-start

(Mandatory) Emulator name.

Since DevEco Studio 6.1.0 Beta1, the -start parameter is added. You are advised to use -start. You need to agree to the HarmonyOS Software License and Service Agreement upon the first use.

-path/-instancePath

(Mandatory) Emulator instance path.

Since DevEco Studio 6.1.0 Beta1, this parameter is optional, and the -instancePath parameter is added. You are advised to use -instancePath. If this parameter is not specified, the emulator instance path in DevEco Studio is used by default.

-imageRoot

(Mandatory) Emulator image path.

Since DevEco Studio 6.1.0 Beta1, this parameter is optional. If this parameter is not specified, the emulator image path in DevEco Studio is used by default.

-hdcport

(Optional) HDC port number. The value ranges from 10000 to 16555. This parameter is supported since DevEco Studio 6.0.1 Beta1.

-bootMode

(Optional) Emulator startup mode. This parameter is supported since DevEco Studio 6.1.0 Release.

If this parameter is not specified, the emulator follows the startup mode configured upon creation. The emulator uses the hot start (snapshot) mode if Quick Boot was enabled during creation, or the -hotBoot true parameter was applied via the command line. Otherwise, it runs in cold start (coldboot) mode.

  • coldboot: full power-on startup. User data such as installed apps and uploaded files is retained from the previous session unless manually cleared.
  • snapshot: hot start, which loads the snapshot saved at the last shutdown during startup and restores the emulator to its previous state. To use this parameter, enable Quick Boot when creating the emulator or add the -hotBoot true parameter when creating the emulator using the command line.
  • reset: full power-on startup after data is cleared.

-noWindow

(Optional) Flag to start the emulator in headless mode. This parameter is mandatory for Linux environments without a GUI and is supported since version 26.0.0.

Example

# DevEco Studio 6.1.0 Beta1 or later
Emulator -start "my Emulator" -instancePath D:\Emulator -imageRoot D:\Sdk
# Versions earlier than DevEco Studio 6.1.0 Beta1
Emulator -hvd "my Emulator" -path D:\Emulator -imageRoot D:\Sdk

If you are required to log in to your developer account to use the Emulator in DevEco Studio, the Emulator of this version cannot be started using the CLI. In this case, start the Emulator in DevEco Studio.

Stopping the Emulator

Emulator -stop {Emulator name}

Example

Emulator -stop "my Emulator"

Configuring an Emulator

Since DevEco Studio 6.1.0 Beta1, you can configure the emulator instance path, image path, and network proxy.

Emulator -config -instancePath {Emulator instance path} -imageRoot {Emulator image path} -http_proxy {Network proxy}

Parameters

Name

Description

-config

(Mandatory) Emulator configuration command.

-instancePath/-path

(Optional) Emulator instance path.

The specified path must exist and can contain only letters, digits, spaces, hyphens (-), and underscores (_). If an emulator instance is running, this parameter cannot be modified.

-imageRoot

(Optional) Emulator image path.

The specified path must exist and can contain only letters, digits, spaces, hyphens (-), and underscores (_). If an emulator instance is running, this parameter cannot be modified.

-http_proxy

(Optional) Network proxy.

Proxy format: {Proxy protocol}://{User name}:{Password}@{Proxy host name}:{Port number}. The proxy protocol can be HTTP or HTTPS. If the password contains special characters, the characters must be escaped.

Example

Emulator -config -instancePath D:/Emulator -imageRoot D:/Sdk -http_proxy "http://user:password@proxy.proxyserver.com:port"

Clearing Emulator Configurations

Since DevEco Studio 6.1.0 Beta1, you can clear emulator configurations, including the emulator instance path, image path, and network proxy.

Emulator -unset instancePath/path/imageRoot/http_proxy

Parameters

Name

Description

-unset

(Mandatory) Command for clearing emulator configurations. Only one configuration can be cleared at a time. The following configurations can be cleared:

  • instancePath/path: Restores the emulator instance path in DevEco Studio to the default path.
  • imageRoot: Restores the emulator image path in DevEco Studio to the default path.
  • http_proxy: Clears the network proxy configuration.

Example

Emulator -unset instancePath

Viewing/Updating the Product List

Since DevEco Studio 6.1.0 Beta1, you can view the product list of the emulator, including the device models and screen parameters (DPI, screen width and height, and screen diagonal length).

This parameter is available only for emulators that support custom screens. For details, see Customizing the Virtual Device Screen.

Emulator -screenProfileList -deviceType {Emulator type} -details -update -http_proxy {Network proxy}

Parameters

Name

Description

-screenProfileList

(Mandatory) Flag to view the emulator product list.

-deviceType

(Optional) Product type of the emulator.

-details

(Optional) Flag to list detailed screen parameters, including the DPI, width, height, and diagonal length of the screen.

-update

(Optional) Flag to obtain the latest emulator product list from the cloud and display it.

-http_proxy

(Optional) Proxy for updating the product list when the network is restricted.

Proxy format: {Proxy protocol}://{User name}:{Password}@{Proxy host name}:{Port number}. The proxy protocol can be HTTP or HTTPS. If the password contains special characters, the characters must be escaped.

Example

$ Emulator -screenProfileList -deviceType phone -details -update -http_proxy "http://user:password@proxy.proxyserver.com:port"
Phone   # Product type
  - "nova 15 Pro,nova 15 Ultra"    # Device model
       density: 560                 # Screen DPI
       screen: 1320 x 2856          # Screen width and height, in pixels
       diagonal: 6.84 inch          # Diagonal length of the screen
  - "nova 15"
       density: 480
       screen: 1084 x 2412
       diagonal: 6.7 inch
  - "Mate 80 Pro Max,Mate 80 RS"
       density: 540
       screen: 1320 x 2848
       diagonal: 6.9 inch
  - "Mate 80,Mate 80 Pro"
       density: 560
       screen: 1280 x 2832
       diagonal: 6.75 inch
...

Collecting Emulator Logs

Once the emulator is up and running, logs can be collected.

# The {Path for storing the .zip log file} must be suffixed with .zip.
Emulator -logZip {Emulator name} -logPath {Path for storing the .zip log file}

Example

Emulator -logZip "my Emulator" -logPath D:\EmulatorLog\Log.zip

Obtaining the Emulator Version

Emulator -version

Viewing the License Agreement

Using the emulator requires acceptance of the HarmonyOS Software License and Service Agreement. Downloading images requires acceptance of the HarmonyOS SDK License Agreement.

Since DevEco Studio 6.1.0 Beta1, viewing all emulator license agreements and choosing whether to accept them is supported.

Emulator -license accept

Parameters

Name

Description

-license

(Mandatory) Flag to print all emulator license agreements. When this parameter is used alone, acceptance is determined through command-line interaction (y/n).

When the accept parameter is included, all emulator license agreements are considered accepted, and the command-line interaction process is skipped.

Scenario-based Simulation

Since version 26.0.0, scenario-based feature simulation is supported via the command line. Supported operations include screen rotation, volume control, screen on/off, and shake.

[h2]Rotation

Emulator -instance {Emulator name} -rotation {left/right}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-rotation

(Mandatory) Rotation command, which rotates the emulator screen left or right.

[h2]Volume Control

Emulator -instance {Emulator name} -volume {up/down}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-volume

(Mandatory) Volume adjustment command, which adjusts the emulator volume up or down.

[h2]Screen On/Off

Emulator -instance {Emulator name} -power

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-power

(Mandatory) Power control command, which simulates screen on/off.

[h2]Shake

Emulator -instance {Emulator name} -shake

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-shake

(Mandatory) Shake command, which simulates a shake gesture.

[h2]Foldable State Control

Emulator -instance {Emulator name} -foldedState {Folded state}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-foldedState

(Mandatory) Command for device folding and unfolding, which controls the folding state of a foldable device. The supported states vary by device type:

  • Bi-folds and Pura X Max: open | half-open | close
  • Widescreen foldables (excluding Pura X Max): open | close
  • 2-in-1 foldables: open | vertical-open | half-open | close
  • Tri-folds: single | double | triple | left-folded-right-half-folded | left-half-folded-right-expanded | left-expanded-right-folded | left-half-folded-right-folded | left-expanded-right-half-folded | left-half-folded-right-half-folded

Example

Emulator -instance "Mate X7" -foldedState half-open

[h2]Screen Capture

Emulator -instance {Emulator name} -screenshot -screenshotPath {Path for saving the screenshot}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-screenshot

(Mandatory) Screenshot command, which takes a screenshot of the emulator screen. You can use the -screenshotPath parameter to specify the path for saving the screenshot. If this parameter is not specified, the screenshot is saved to the default path, which can be changed via Settings on the emulator toolbar.

-screenshotPath

(Optional) Path for saving the screenshot. This parameter must be used together with the -screenshot command and is valid for a single use only. When this parameter is specified, the screenshot is not saved to the default path.

Example

Emulator -instance "Mate 80 Pro" -screenshot -screenshotPath "D:\"

[h2]Battery

Emulator -instance {Emulator name} -battery {Battery level}
Emulator -instance {Emulator name} -batteryStatus {0/1}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-battery

(Mandatory) Battery level of the emulator. The value ranges from 0 to 100 when the emulator is being charged, and from 1 to 100 when the emulator is not being charged.

-batteryStatus

(Mandatory) Emulator charging state.

  • 0: not charging
  • 1: charging

Example

Emulator -instance "Mate 80 Pro" -battery 50
Emulator -instance "Mate 80 Pro" -batteryStatus 1

[h2]GPS

Emulator -instance {Emulator name} -gps {-longitude/-latitude/-altitude/-city/-bearing} {GPS parameter value}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-gps

(Mandatory) GPS simulation command. The GPS parameters are optional and can be used in combination. When -city conflicts with other parameters, -city takes precedence and conflicting parameters are ignored.

-longitude

(Optional) Longitude. The value range is [–180.0, 180.0], and up to eight decimal places are supported.

-latitude

(Optional) Latitude. The value range is [–90.0, 90.0], and up to eight decimal places are supported.

-altitude

(Optional) Altitude. The value range is [–10000.0, 10000.0], and up to two decimal places are supported.

-city

(Optional) City. The value is case-insensitive.

  • Supported values in the Chinese mainland:

    Beijing/Shanghai/Guangzhou/Tianjin/Chongqing/Zhengzhou/Shijiazhuang/Taiyuan/Jinan/Changsha/Wuhan/Harbin/Changchun/Shenyang/Nanjing/Hangzhou/Fuzhou/Hefei/Nanchang/Xian/Chengdu/Guiyang/Haikou/Taipei/Kunming/Lanzhou/Xining/Hohhot/Urumqi/Lhasa/Yinchuan/Nanning/Hong Kong/Macao

  • Supported values in other countries or regions:

    Beijing/Shanghai/New York/London/Moscow/Paris

-bearing

(Optional) Azimuth. The value range is [0.0, 359.99], and up to two decimal places are supported.

Example

Emulator -instance "Mate 80 Pro" -gps -longitude 180 -latitude 90 -altitude 2000 -bearing 200

[h2]Scenario Simulation

Emulator -instance {Emulator name} -outdoorRunning
Emulator -instance {Emulator name} -outdoorCycling
Emulator -instance {Emulator name} -drivingNavigation

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-outdoorRunning

(Mandatory) Outdoor running simulation command.

-outdoorCycling

(Mandatory) Outdoor cycling simulation command.

-drivingNavigation

(Mandatory) Driving navigation simulation command.

[h2]Sensor

Emulator -instance {Emulator name} -sensor {-light/-steps/-heartrate} {Sensor parameter value}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-sensor

(Mandatory) Sensor type. Only one type of sensor can be set at a time.

-light

(Optional) Light sensor parameter. The value range is [0.0, 100000.0], with one decimal place supported.

-steps

(Optional) Step count sensor parameter. The value range is [0, 100000].

-heartrate

(Optional) Heart rate sensor parameter. The value range is [0, 255].

Example

Emulator -instance "Mate 80 Pro" -sensor -light 50

[h2]Obtaining UI Layout Information

Emulator -instance {Emulator name} -uiLayout {-i/-a}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-uiLayout

(Mandatory) Flag to obtain the layout information of the current UI.

-i

(Optional) Flag to output only interactive components, such as clickable, editable, and scrollable components.

-a

(Optional) Flag to output the color style information of components. No such information is output for components whose color styles are not configured.

This command is not supported in multi-screen scenarios.

Example

$ Emulator -instance "Mate 80 Pro" -uiLayout -i
Scenario simulation success.
Analysis saved to: C:/Emulator/Mate 80 Pro/uiLayout/analysis.md
# Widget Tree Analysis
- **Generated**: 2026-08-06 16:05:28
- **Mode**: Interactive Only
---
## Widget Tree
- __Common__ [id:5] [top: 0, left: 0, width: 1256, height: 2382]                       # top: Y-coordinate; left: X-coordinate, with the top-left corner of the emulator as the origin (0,0)
  - Swiper Swiper [id:7] [top: 136, left: 0, width: 1256, height: 2246]
    - GridItem GridItem [id:11] [top: 230, left: 30, width: 299, height: 329]
      - RelativeContainer image Settings [id:14] [top: 260, left: 88, width: 182, height: 244]
    - GridItem GridItem [id:15] [top: 230, left: 329, width: 299, height: 329]
      - RelativeContainer image Gallery [id:18] [top: 260, left: 387, width: 182, height: 244]
    - GridItem GridItem [id:19] [top: 230, left: 628, width: 299, height: 329]
      - RelativeContainer image File Manager [id:22] [top: 260, left: 679, width: 197, height: 244]
    - GridItem GridItem [id:23] [top: 230, left: 926, width: 299, height: 329]
      - RelativeContainer image Calendar [id:26] [top: 260, left: 984, width: 182, height: 244]
- Column [id:34] [top: 2382, left: 0, width: 1256, height: 378]
  - Image Image [id:41] [top: 2424, left: 387, width: 182, height: 182]
  - Image Image [id:44] [top: 2424, left: 686, width: 182, height: 182]

[h2]Click

Emulator -instance {Emulator name} -click {Component ID/Screen coordinates}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-click

(Mandatory) ID or coordinates of the component to click, which can be obtained from the UI layout information.

This command is not supported in multi-screen scenarios.

Example

Emulator -instance "Mate 80 Pro" -click 10
Emulator -instance "Mate 80 Pro" -click "100 100"   # Trigger a click on the component at screen coordinates (100, 100).

[h2]Swipe

Emulator -instance {Emulator name} -slide {Component ID} {Direction (left/right/up/down)}
Emulator -instance {Emulator name} -slide {Component ID} { Screen coordinates}
Emulator -instance {Emulator name} -slide {Start coordinates} {End coordinates}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-slide

(Mandatory) Target component ID and swipe direction, or target component ID and destination screen coordinates, or start and end screen coordinates for swipe gestures. You can obtain the component ID or coordinates from the UI layout information.

This command is not supported in multi-screen scenarios.

Example

Emulator -instance "Mate 80 Pro" -slide "10 up"
Emulator -instance "Mate 80 Pro" -slide "10 100 100"       # Swipe from component 10 to screen coordinates (100, 100).
Emulator -instance "Mate 80 Pro" -slide "100 100 200 200"  # Swipe from screen coordinates (100, 100) to screen coordinates (200, 200).

[h2]Input

Emulator -instance {Emulator name} -fill {Component ID} {Input content}

Parameters

Name

Description

-instance

(Mandatory) Emulator name.

-fill

(Mandatory) Target component ID and input content for text injection. The component ID can be obtained from the UI layout information.

This command is not supported in multi-screen scenarios.

Example

Emulator -instance "Mate 80 Pro" -fill "10 Hello,World"