Documentation ¶
Overview ¶
Ref link https://github.com/openstf/adbkit/blob/master/src/adb/tcpusb/socket.coffee
Index ¶
- Constants
- Variables
- type ADBConn
- func (conn *ADBConn) CheckOKAY() error
- func (conn *ADBConn) DecodeString() (string, error)
- func (conn *ADBConn) Encode(v []byte) error
- func (conn *ADBConn) EncodeString(s string) error
- func (conn *ADBConn) Err() error
- func (conn *ADBConn) Read(p []byte) (n int, err error)
- func (conn *ADBConn) ReadN(n int) (data []byte, err error)
- func (conn *ADBConn) ReadNString(n int) (data string, err error)
- func (conn *ADBConn) ReadUint32() (i uint32, err error)
- func (conn *ADBConn) Write(p []byte) (n int, err error)
- func (conn *ADBConn) WriteLE(v interface{}) error
- func (conn *ADBConn) WriteObjects(objs ...interface{}) error
- func (conn *ADBConn) WriteString(s string) (int, error)
- type ADBDaemon
- type Client
- func (c *Client) Device(descriptor DeviceDescriptor) *Device
- func (c *Client) DeviceWithSerial(serial string) *Device
- func (c *Client) KillServer() error
- func (c *Client) ListDevices() (devs []*Device, err error)
- func (c *Client) ServerVersion() (v int, err error)
- func (c *Client) StartServer() (err error)
- type Device
- func (d *Device) OpenShell(cmd string) (rwc io.ReadWriteCloser, err error)
- func (d *Device) OpenTransport() (conn *ADBConn, err error)
- func (ad *Device) Properties() (props map[string]PropValue, err error)
- func (d *Device) RunCommand(args ...string) (output string, err error)
- func (d *Device) Serial() (serial string, err error)
- func (d *Device) ServeTCP(in net.Conn)
- func (d *Device) Stat(path string) (info os.FileInfo, err error)
- func (d *Device) String() string
- type DeviceDescriptor
- type DeviceState
- type Packet
- type PacketReader
- type PacketWriter
- type PropValue
- type Session
- type TransportService
Constants ¶
View Source
const ( StateDisconnected = DeviceState("disconnected") StateOffline = DeviceState("offline") StateOnline = DeviceState("device") )
View Source
const ( // host:transport-any and host:<request> DeviceAny deviceDescriptorType = iota // host:transport:<serial> and host-serial:<serial>:<request> DeviceSerial // host:transport-usb and host-usb:<request> DeviceUsb // host:transport-local and host-local:<request> DeviceLocal )
View Source
const ( ModeDir uint32 = 0040000 ModeSocket = 0140000 ModeSymlink = 0120000 ModeRegular = 0100000 ModeNamedPipe = 0010000 ModeCharDevice = 0020000 ModeSetuid = 0004000 ModeSetgid = 0002000 ModePerm = 0000777 )
View Source
const ( UINT16_MAX = 0xFFFF UINT32_MAX = 0xFFFFFFFF AUTH_TOKEN = 1 AUTH_SIGNATURE = 2 AUTH_RSAPUBLICKEY = 3 TOKEN_LENGTH = 20 )
Variables ¶
View Source
var ( ErrChecksum = errors.New("adb: checksum error") ErrCheckMagic = errors.New("adb: magic error") )
Functions ¶
This section is empty.
Types ¶
type ADBConn ¶
func NewADBConn ¶
func (*ADBConn) DecodeString ¶
func (*ADBConn) EncodeString ¶
func (*ADBConn) ReadUint32 ¶
func (*ADBConn) WriteObjects ¶
WriteObjects according to type
type ADBDaemon ¶
type ADBDaemon struct {
// contains filtered or unexported fields
}
ADBDaemon implement service for command: adb connect
func NewADBDaemon ¶
func (*ADBDaemon) ListenAndServe ¶
type Client ¶
type Client struct {
Addr string
}
func (*Client) Device ¶
func (c *Client) Device(descriptor DeviceDescriptor) *Device
func (*Client) DeviceWithSerial ¶
func (*Client) KillServer ¶
KillServer tells the server to quit immediately
func (*Client) ListDevices ¶
ListDevices returns the list of connected devices
func (*Client) ServerVersion ¶
ServerVersion returns int. 39 means 1.0.39
func (*Client) StartServer ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device
func (*Device) OpenShell ¶
func (d *Device) OpenShell(cmd string) (rwc io.ReadWriteCloser, err error)
func (*Device) OpenTransport ¶
OpenTransport is a low level function Connect to adbd.exe and send <host-prefix>:transport and check OKAY conn should be Close after using
type DeviceDescriptor ¶
type DeviceDescriptor struct {
// contains filtered or unexported fields
}
func AnyDevice ¶
func AnyDevice() DeviceDescriptor
func AnyLocalDevice ¶
func AnyLocalDevice() DeviceDescriptor
func AnyUsbDevice ¶
func AnyUsbDevice() DeviceDescriptor
func DeviceWithSerial ¶
func DeviceWithSerial(serial string) DeviceDescriptor
func (DeviceDescriptor) String ¶
func (d DeviceDescriptor) String() string
type DeviceState ¶
type DeviceState string
type Packet ¶
Packet is a meta for adb connect
func (Packet) BodySkipNull ¶
func (Packet) DumpToStdout ¶
func (pkt Packet) DumpToStdout()
func (Packet) EncodeToBytes ¶
type PacketReader ¶
type PacketReader struct { C chan Packet // contains filtered or unexported fields }
func NewPacketReader ¶
func NewPacketReader(reader io.Reader) *PacketReader
func (*PacketReader) Err ¶
func (p *PacketReader) Err() error
type PacketWriter ¶
type PacketWriter struct {
// contains filtered or unexported fields
}
func NewPacketWriter ¶
func NewPacketWriter(w io.Writer) *PacketWriter
func (*PacketWriter) WritePacket ¶
func (p *PacketWriter) WritePacket(pkt Packet) error
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session created when adb connected
type TransportService ¶
type TransportService struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.