Versions in this module Expand all Collapse all v0 v0.1.0 Jan 14, 2023 Changes in this version + var ErrConnUSB = errors.New("cannot call connect/disconnect to device using USB") + var ErrCoordinatesNotFound = errors.New("coordinates for an input event are missing") + var ErrNotInstalled = errors.New("adb is not installed or not in PATH") + var ErrResolutionParseFail = errors.New("failed to parse screen size from input text") + var ErrStdoutEmpty = errors.New("stdout expected to contain data but was empty") + var ErrUnspecified = errors.New("an unknown error has occurred, please open an issue on GitHub") + func KillServer(ctx context.Context) error + type ConnOptions struct + Address net.IPAddr + Port uint + SerialNo Serial + type Connection int + const Network + const USB + type Device struct + ConnType Connection + FileHandle string + IP net.IPAddr + IsAuthorized bool + Port uint + SerialNo Serial + func Connect(ctx context.Context, opts ConnOptions) (Device, error) + func Devices(ctx context.Context) ([]Device, error) + func (d Device) CaptureSequence(ctx context.Context) (t TapSequence, err error) + func (d Device) ConnString() string + func (d Device) Disconnect(ctx context.Context) error + func (d Device) GetScreenResolution(ctx context.Context) (res Resolution, err error) + func (d Device) GoBack(ctx context.Context) error + func (d Device) GoHome(ctx context.Context) error + func (d Device) LongPress(ctx context.Context, X, Y int) error + func (d Device) Pull(ctx context.Context, src, dest string) error + func (d Device) Push(ctx context.Context, src, dest string) error + func (d Device) Reboot(ctx context.Context) error + func (d Device) Reconnect(ctx context.Context) (Device, error) + func (d Device) ReplayTapSequence(ctx context.Context, t TapSequence) error + func (d Device) Root(ctx context.Context) (success bool, err error) + func (d Device) Shell(ctx context.Context, command string) (stdout string, stderr string, ErrCode int, err error) + func (d Device) Swipe(ctx context.Context, X1, Y1, X2, Y2 int, duration time.Duration) error + func (d Device) SwitchApp(ctx context.Context) error + func (d Device) Tap(ctx context.Context, X, Y int) error + type Input interface + EndTime func() time.Time + Length func() time.Duration + Play func(d Device, ctx context.Context) error + StartTime func() time.Time + type Resolution struct + Height int + Width int + type SeqType int + const SeqSleep + const SeqSwipe + const SeqTap + type SequenceImporter struct + Duration time.Duration + End time.Time + Start time.Time + Type SeqType + X int + X1 int + X2 int + Y int + Y1 int + Y2 int + func (si SequenceImporter) ToInput() Input + type SequenceSleep struct + Duration time.Duration + Type SeqType + func (s SequenceSleep) EndTime() time.Time + func (s SequenceSleep) Length() time.Duration + func (s SequenceSleep) Play(d Device, ctx context.Context) error + func (s SequenceSleep) StartTime() time.Time + type SequenceSwipe struct + End time.Time + Start time.Time + Type SeqType + X1 int + X2 int + Y1 int + Y2 int + func (s SequenceSwipe) EndTime() time.Time + func (s SequenceSwipe) Length() time.Duration + func (s SequenceSwipe) Play(d Device, ctx context.Context) error + func (s SequenceSwipe) StartTime() time.Time + type SequenceTap struct + End time.Time + Start time.Time + Type SeqType + X int + Y int + func (s SequenceTap) EndTime() time.Time + func (s SequenceTap) Length() time.Duration + func (s SequenceTap) Play(d Device, ctx context.Context) error + func (s SequenceTap) StartTime() time.Time + type Serial string + type TapSequence struct + Events []Input + Resolution Resolution + func TapSequenceFromJSON(j []byte) (TapSequence, error) + func (t TapSequence) GetLength() time.Duration + func (t TapSequence) ShortenSleep(scalar int) TapSequence + func (t TapSequence) ToJSON() []byte + type TapSequenceImporter struct + Events []SequenceImporter + Resolution Resolution