Port IMAGE - DEFAULT

Default port for interaction with Android devices.

Stimulation

此端口不具备激励能力。

Name

在以下情况下可用

默认值

有效值

Type

Description

Device

[<auto>, <manual>, <online query>]

string

Device that will be connected to the Tool Server.

Device ID or network address

Device: ‘<manual>’

string

Device ID or IP/hostname and port of the device, e.g. “emulator-5554” or “192.168.100:10:37775”. If there is no port given, the default port 5555 will be used.

Display Id

‘<auto>’

string

The image port will interact with the given display when reading images. You can list the available display Ids with the adb command “adb shell dumpsys SurfaceFlinger –display-id”. With the option “<auto>” the default display will be used.

Display Id ❲HWC❳

‘<auto>’

string

The Hardware Composer (HWC) Id of the target display. This is required for performing touch actions on a specific display. You can list the available Ids with the command “adb shell dumpsys SurfaceFlinger –display-id”. With the option “<auto>” the default display will be used.

Live preview

☐

bool

在配置的网络端口上流式传输实时预览。可通过工具主机的 IP 地址和配置的端口访问实时流,例如本地工具连接:http://127.0.0.1:<port>

打开预览窗口

实时预览

☑

bool

加载配置时打开预览窗口。该窗口以直播流形式显示图像源的当前输出,并且在测试配置激活期间始终保持打开。

Port

实时预览

‘<auto>’

string

用于实时流的网络端口。如果为多个视频源启用实时流,则每个实时流都需要一个唯一的端口。如果将该值设为 <auto>,系统将分配一个空闲的网络端口。

Show text overlay in video recordings

☐

bool

在视频 Recording 的左下角添加格式为 “timestamp package name” 的文本叠加。

ClearAndroidPackageData

Deletes user data for the given package.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

packageName

string

Package name of the installed app, e.g. “com.google.android.youtube”.

ExecuteShellCommand

Executes a shell command on the device and returns the result. The shell and all child processes are terminated afterward.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

cmd

string

Shell command, e.g. “input tap 0 0”.

timeout

0

int

Timeout in seconds.

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

result

string

Return value of the command.

GetCurrentActivity

Returns the currently active package and activity.

Parameterization

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

result

string

The currently active package resp. activity.

GetCurrentApp

Returns the name of the currently active app, e.g. “Chrome”.

Parameterization

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

result

string

Currently active app.

GetInstalledApps

Returns a list of all installed apps.

Parameterization

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

result

object

List of all installed apps.

InputText

Types the given text and presses enter to confirm the input if option is set.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

pressReturn

☐

bool

If True, Enter is pressed after the input.

text

string

Text that will be typed.

PressHardwareButton

Simulates pressing a hardware button.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

key

‘KEYCODE_HOME’

[‘KEYCODE_HOME’, ‘KEYCODE_BACK’, ‘KEYCODE_APP_SWITCH’]

string

Name of the hardware button that will be pressed or any other key event. Available key events are listet at https://developer.android.com/reference/android/view/KeyEvent.

pushDuration

‘short’

[‘short’, ‘long’]

string

Duration of the keypress.

PullFile

Downloads a file or directory from the Android device.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

localFilePath

string

Local path of the file or directory on the test computer. If empty, the resource will be saved in the report directory.

remoteFilePath

string

Path of a file or directory on the Android device, e.g. “/sdcard/Download/filename.ext” or “/sdcard/Download/dirname”.

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

localFilePath

string

The local destination path for the downloaded file or directory.

PushFile

Uploads a local file or directory to the Android device.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

localFilePath

string

Local path of a file or directory on the computer.

remoteFilePath

string

Path of the file or directory on the Android device, e.g. “/sdcard/Download/filename.ext” or “/sdcard/Download/dirname”.

ShellSessionClose

Closes the shell session with the given Id and terminates all child processes.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

shellId

string

Id of the shell session that will be used. If the session does not exist, an exception will be thrown.

ShellSessionExecuteCommand

Clears stdout and stderr, writes a command to the stdin stream of the shell session, reads the output streams and returns the output buffer.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

cmd

string

Command that will be executed, e.g. “ls -l” to list the current directory or “echo ${?}” to get the last return code.

cmdTimeout

10

float

The command timeout is measured in seconds. It stops reading from stdout and stderr when this takes longer than the given timeout.If the timeout is 0 or smaller, it will be ignored.

perLineTimeout

5

float

The per line timeout is measured in seconds. It stops reading from stdout or stderr when reading a single line takes longer than the timeout. If the timeout is 0 or smaller, it will be ignored.

shellId

string

Id of the shell session that will be used. If the session does not exist, an exception will be thrown.

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

result

object

Returns a tuple with the received data from stdout and stderr streams. The data might be incomplete if one of the timeouts was reached.

ShellSessionOpen

Creates a new ADB shell session that can be queried with read/write jobs.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

shellId

string

Id of the shell session that will be created. The Id is needed for read/write/close actions on this shell. If empty, an Id will be generated.

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

result

string

Returns the given or created shell session Id.

ShellSessionRead

Reads stdout or stderr stream and returns the data.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

perLineTimeout

5

float

The per line timeout is measured in seconds. It stops reading from stdout or stderr when reading a single line takes longer than the timeout. If the timeout is 0 or smaller, it will be ignored.

shellId

string

Id of the shell session that will be used. If the session does not exist, an exception will be thrown.

stderr

☐

bool

Reads and returns the stderr stream instead of stdout.

ShellSessionWrite

Writes to the stdin stream of the shell session.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

cmd

string

Input that will be sent to the stdin stream.

newLine

☑

bool

Adds the newline character “\n” at the end of the input to simulate the Enter key.

shellId

string

Id of the shell session that will be used. If the session does not exist, an exception will be thrown.

StartAndroidPackage

Starts the given activity of a package.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

activityName

string

App activity, e.g. “/.HomeActivity”.

packageName

string

Package name of the installed app, e.g. “com.google.android.youtube”.

StartApp

Starts the given app.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

appName

string

Name of the app that will be started, e.g. “Chrome”.

返回值

Name

在以下情况下可用

默认值

有效值

Type

Description

result

string

The package path of the started Android app.

StopAndroidPackage

Closes the given package.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

packageName

string

Package name of the installed app, e.g. “com.google.android.youtube”.

StopApp

Closes an app.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

appName

string

Name of the app that will be closed, e.g. “Chrome”.

SwipeOnScreen

Simulates a swipe input on the device.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

duration

0

int

Duration of a swipe input in milliseconds.

startPosX

0

int

Pixel position (x axis)

startPosY

0

int

Pixel position (y axis)

targetPosX

0

int

Pixel position (x axis)

targetPosY

0

int

Pixel position (y axis)

TouchOnScreen

Simulates a touch input on the device.

Parameterization

Parameter

Name

在以下情况下可用

默认值

有效值

Type

Description

duration

0

int

Holding time in milliseconds

positionX

0

int

Pixel position (x axis)

positionY

0

int

Pixel position (y axis)