adb

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps ADB command-line calls.

func NewClient

func NewClient(adbPath ...string) *Client

NewClient creates a new ADB client. If adbPath is empty, "adb" is used (found via PATH).

func (*Client) Bin added in v0.5.0

func (c *Client) Bin() string

Bin returns the adb binary path.

func (*Client) Connect

func (c *Client) Connect(ip string, port int) error

Connect connects to a wireless ADB device.

func (*Client) Devices

func (c *Client) Devices() ([]Device, error)

Devices returns all connected ADB devices.

func (*Client) ListFiles

func (c *Client) ListFiles(serial, remotePath string) ([]FileInfo, error)

ListFiles lists files in a directory on the device, non-recursively.

func (*Client) ListFilesRecursive

func (c *Client) ListFilesRecursive(serial, remotePath string) ([]FileInfo, error)

ListFilesRecursive lists all files recursively under a directory.

func (*Client) ListFilesRecursiveCtx added in v0.5.0

func (c *Client) ListFilesRecursiveCtx(ctx context.Context, serial, remotePath string) ([]FileInfo, error)

ListFilesRecursiveCtx is like ListFilesRecursive but accepts a context for cancellation.

func (*Client) Pull

func (c *Client) Pull(serial, remotePath, localPath string) error

Pull copies a file from the device to the local filesystem.

func (*Client) Remove

func (c *Client) Remove(serial, remotePath string) error

Remove deletes a file on the device.

type ConnectionType

type ConnectionType string

ConnectionType indicates how a device is connected.

const (
	USB     ConnectionType = "usb"
	WiFi    ConnectionType = "wifi"
	Unknown ConnectionType = "unknown"
)

type Device

type Device struct {
	Serial      string
	State       string // "device", "offline", "unauthorized", etc.
	ConnType    ConnectionType
	Model       string
	Product     string
	TransportID string
}

Device represents a connected ADB device.

func (Device) IsOnline

func (d Device) IsOnline() bool

IsOnline returns true if the device is in "device" state (ready).

type FileInfo

type FileInfo struct {
	Path  string
	Size  int64
	MTime time.Time
}

FileInfo represents a file on the Quest filesystem.

Jump to

Keyboard shortcuts

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