android

package
v0.0.0-...-31fda41 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceSession

type DeviceSession interface {
	BootCompleted() (bool, error)
	RunCommand(bool, ...string) ([]byte, error)
	DownloadFile(string, io.Writer) error
	GetScreencap() (image.Image, error)
	GetScreencapPNG() ([]byte, error)
	GetInvertedScreencapPNG() ([]byte, error)
	GotoLauncher() error
	LaunchApp(string) error
	Tap(x, y, count int) error
	TapAtString(*TapOptions) error
	Tab() error
	InputText(string) error
	RemoveText(int) error
	Close()
}

DeviceSession provides an interface for interacting with an emulated device over ADB. It includes utility functions for searching and detecting text on the screen via OCR.

func NewSession

func NewSession(logger logr.Logger, host string, port int32) (DeviceSession, error)

NewSession returns a connected device session or any error that arises.

type TapLocation

type TapLocation string

TapLocation represents a location on the screen to tap when searching for text

const (
	// OnString taps on the found string itself
	OnString TapLocation = "OnString"
	// StartOfLine taps on the far left side of the screen where the string was found
	StartOfLine TapLocation = "StartOfLine"
	// EndOfLine taps on the far right side of the screen where the string was found
	EndOfLine TapLocation = "EndOfLine"
)

type TapOptions

type TapOptions struct {
	// The string to search for tap
	String string
	// The number of clicks to send when the string is found
	Count int
	// Whether to attempt scrolling until the string is found
	Scroll bool
	// Whether to attempt inverting image pixels when looking for the string
	Invert bool
	// Where to send the tap event when the string is found
	TapLocation TapLocation
}

TapOptions are options passed to a tap method

func (*TapOptions) GetCount

func (t *TapOptions) GetCount() int

GetCount returns the number of taps that should be sent

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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