adbKit

package
v3.26.153 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check added in v3.26.104

func Check(ctx context.Context) (path string, version string, err error)

Check 检查 adb 环境.

@param logger: 可以为nil(默认输出到控制台) @return path: adb可执行文件的绝对路径 @return version: adb版本号

func Clean added in v3.26.104

func Clean(ctx context.Context, logger *zap.Logger) error

Clean 清理 adb 环境.

!!!: 调用此函数前,需要先调用 Check.

Types

type Client added in v3.26.105

type Client interface {
	GetAddress() string

	GetPhysicalSize(ctx context.Context) (width int, height int, err error)

	Screenshot(ctx context.Context, targetPath string) error

	// Tap 点击.
	Tap(ctx context.Context, x, y int) error
	// LongPress 长按.
	LongPress(ctx context.Context, x, y int, duration int) error
	// Swipe 滑动.
	Swipe(ctx context.Context, x1, y1, x2, y2 int, duration int) error

	TapAsHumanBeings(ctx context.Context, x, y int, axisOffset int) error
	LongPressAsHumanBeings(ctx context.Context, x, y int, duration int, axisOffset, timeOffset int) error
	SwipeAsHumanBeings(ctx context.Context, x1, y1, x2, y2 int, duration int, axisOffset, timeOffset int) error
}

func NewClient added in v3.26.105

func NewClient(ctx context.Context, address string, cleanFlag bool, logger *zap.Logger) (Client, error)

NewClient

@param logger: 可以为nil(默认:丢弃输出)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL