gadb

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 12 Imported by: 21

README

gadb

ADB Client in pure Golang.

Documentation

Index

Constants

View Source
const AdbDaemonPort = 5555
View Source
const AdbServerPort = 5037
View Source
const DefaultFileMode = os.FileMode(0664)

Variables

View Source
var DefaultAdbReadTimeout time.Duration = 10
View Source
var ErrConnBroken = errors.New("socket connection broken")

Functions

func SetDebug

func SetDebug(debug bool)

SetDebug set debug mode

Types

type Client

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

func NewClient

func NewClient() (Client, error)

func NewClientWith

func NewClientWith(host string, port ...int) (adbClient Client, err error)

func (Client) Connect added in v0.0.3

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

func (Client) DeviceList

func (c Client) DeviceList() (devices []Device, err error)

func (Client) DeviceSerialList

func (c Client) DeviceSerialList() (serials []string, err error)

func (Client) Disconnect added in v0.0.3

func (c Client) Disconnect(ip string, port ...int) (err error)

func (Client) DisconnectAll added in v0.0.3

func (c Client) DisconnectAll() (err error)

func (Client) ForwardKillAll added in v0.0.3

func (c Client) ForwardKillAll() (err error)

func (Client) ForwardList added in v0.0.3

func (c Client) ForwardList() (deviceForward []DeviceForward, err error)

func (Client) KillServer

func (c Client) KillServer() (err error)

func (Client) ServerVersion

func (c Client) ServerVersion() (version int, err error)

type Device

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

func (Device) DeviceInfo

func (d Device) DeviceInfo() map[string]string

func (Device) DevicePath

func (d Device) DevicePath() (string, error)

func (Device) EnableAdbOverTCP added in v0.0.3

func (d Device) EnableAdbOverTCP(port ...int) (err error)

func (Device) Forward

func (d Device) Forward(localPort, remotePort int, noRebind ...bool) (err error)

func (Device) ForwardKill

func (d Device) ForwardKill(localPort int) (err error)

func (Device) ForwardList

func (d Device) ForwardList() (deviceForwardList []DeviceForward, err error)

func (Device) IsUsb

func (d Device) IsUsb() bool

func (Device) List added in v0.0.5

func (d Device) List(remotePath string) (devFileInfos []DeviceFileInfo, err error)

func (Device) Model

func (d Device) Model() string

func (Device) Product

func (d Device) Product() string

func (Device) Pull added in v0.0.6

func (d Device) Pull(remotePath string, dest io.Writer) (err error)

func (Device) Push added in v0.0.5

func (d Device) Push(source io.Reader, remotePath string, modification time.Time, mode ...os.FileMode) (err error)

func (Device) PushFile added in v0.0.5

func (d Device) PushFile(local *os.File, remotePath string, modification ...time.Time) (err error)

func (Device) RunShellCommand

func (d Device) RunShellCommand(cmd string, args ...string) (string, error)

func (Device) RunShellCommandWithBytes added in v0.0.4

func (d Device) RunShellCommandWithBytes(cmd string, args ...string) ([]byte, error)

func (Device) Serial

func (d Device) Serial() string

func (Device) State

func (d Device) State() (DeviceState, error)

func (Device) Usb

func (d Device) Usb() string

type DeviceFileInfo added in v0.0.5

type DeviceFileInfo struct {
	Name         string
	Mode         os.FileMode
	Size         uint32
	LastModified time.Time
}

func (DeviceFileInfo) IsDir added in v0.0.5

func (info DeviceFileInfo) IsDir() bool

type DeviceForward added in v0.0.4

type DeviceForward struct {
	Serial string
	Local  string
	Remote string
}

type DeviceState

type DeviceState string
const (
	StateUnknown      DeviceState = "UNKNOWN"
	StateOnline       DeviceState = "online"
	StateOffline      DeviceState = "offline"
	StateDisconnected DeviceState = "disconnected"
)

Jump to

Keyboard shortcuts

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