adb

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when the ADB device is not found.
	ErrNotFound = fmt.Errorf("ADB device not found")
	// ErrDeviceOffline is returned when the ADB device is not reachable.
	// This usually requires a restart of the adbd server daemon on the device.
	ErrDeviceOffline = fmt.Errorf("ADB device is offline")
)

Functions

func FindAdbPath

func FindAdbPath() string

Types

type ADBCommand

type ADBCommand struct {
	// contains filtered or unexported fields
}

func (*ADBCommand) Interactive

func (a *ADBCommand) Interactive() (io.WriteCloser, io.Reader, io.Reader, remote.Closer, error)

func (*ADBCommand) Output

func (a *ADBCommand) Output(ctx context.Context) ([]byte, error)

func (*ADBCommand) Run

func (a *ADBCommand) Run(ctx context.Context) error

type ADBConnection

type ADBConnection struct {
	// contains filtered or unexported fields
}

func FromHost

func FromHost(host string, adbPath string) (*ADBConnection, error)

func FromSerial

func FromSerial(serial string, adbPath string) (*ADBConnection, error)

FromSerial creates an ADBConnection from a device serial number. returns an error NotFoundErr if the device is not found, and DeviceOfflineErr if the device is offline.

func (*ADBConnection) Forward

func (a *ADBConnection) Forward(ctx context.Context, localPort int, remotePort int) error

func (*ADBConnection) ForwardKillAll

func (a *ADBConnection) ForwardKillAll(ctx context.Context) error

func (*ADBConnection) GetCmd

func (a *ADBConnection) GetCmd(cmd string, args ...string) remote.Cmder

func (*ADBConnection) List

func (a *ADBConnection) List(path string) ([]remote.FileInfo, error)

func (*ADBConnection) MkDirAll

func (a *ADBConnection) MkDirAll(path string) error

func (*ADBConnection) ReadFile

func (a *ADBConnection) ReadFile(path string) (io.ReadCloser, error)

func (*ADBConnection) Remove

func (a *ADBConnection) Remove(path string) error

func (*ADBConnection) Stats

func (a *ADBConnection) Stats(p string) (remote.FileInfo, error)

func (*ADBConnection) WriteFile

func (a *ADBConnection) WriteFile(r io.Reader, path string) error

Jump to

Keyboard shortcuts

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