Documentation ¶
Index ¶
- Constants
- Variables
- func DisableTimeWait(conn *net.TCPConn) error
- type Client
- func (c Client) Connect(ip string, port ...int) (err error)
- func (c Client) DeviceList() (devices []*Device, err error)
- func (c Client) DeviceSerialList() (serials []string, err error)
- func (c Client) Disconnect(ip string, port ...int) (err error)
- func (c Client) DisconnectAll() (err error)
- func (c Client) ForwardKillAll() (err error)
- func (c Client) ForwardList() (deviceForward []DeviceForward, err error)
- func (c Client) KillServer() (err error)
- func (c Client) ServerVersion() (version int, err error)
- type Device
- func (d *Device) DeviceInfo() map[string]string
- func (d *Device) DevicePath() (string, error)
- func (d *Device) EnableAdbOverTCP(port ...int) (err error)
- func (d *Device) Forward(localPort int, remoteInterface interface{}, noRebind ...bool) (err error)
- func (d *Device) ForwardKill(localPort int) (err error)
- func (d *Device) ForwardList() (deviceForwardList []DeviceForward, err error)
- func (d *Device) GetFeatures() (features Features, err error)
- func (d *Device) HasFeature(name Feature) bool
- func (d *Device) InstallAPK(apk io.ReadSeeker) (string, error)
- func (d *Device) IsUsb() bool
- func (d *Device) List(remotePath string) (devFileInfos []DeviceFileInfo, err error)
- func (d *Device) Model() string
- func (d *Device) Product() string
- func (d *Device) Pull(remotePath string, dest io.Writer) (err error)
- func (d *Device) Push(source io.Reader, remotePath string, modification time.Time, ...) (err error)
- func (d *Device) PushFile(local *os.File, remotePath string, modification ...time.Time) (err error)
- func (d *Device) ReverseForward(localPort int, remoteInterface interface{}, noRebind ...bool) (err error)
- func (d *Device) ReverseForwardKill(remoteInterface interface{}) error
- func (d *Device) ReverseForwardKillAll() error
- func (d *Device) ReverseForwardList() (deviceForwardList []DeviceForward, err error)
- func (d *Device) RunShellCommand(cmd string, args ...string) (string, error)
- func (d *Device) RunShellCommandV2(cmd string, args ...string) (string, error)
- func (d *Device) RunShellCommandV2WithBytes(cmd string, args ...string) ([]byte, error)
- func (d *Device) RunShellCommandWithBytes(cmd string, args ...string) ([]byte, error)
- func (d *Device) ScreenCap() ([]byte, error)
- func (d *Device) Serial() string
- func (d *Device) State() (DeviceState, error)
- func (d *Device) Uninstall(packageName string, keepData ...bool) (string, error)
- func (d *Device) Usb() string
- type DeviceFileInfo
- type DeviceForward
- type DeviceState
- type Feature
- type Features
Constants ¶
View Source
const ( AdbServerPort = 5037 AdbDaemonPort = 5555 )
View Source
const DefaultFileMode = os.FileMode(0o664)
Variables ¶
View Source
var ( FeatSendrecvV2Brotli = Feature("sendrecv_v2_brotli") FeatRemountShell = Feature("remount_shell") FeatSendrecvV2 = Feature("sendrecv_v2") FeatAbbExec = Feature("abb_exec") FeatFixedPushMkdir = Feature("fixed_push_mkdir") FeatFixedPushSymlinkTimestamp = Feature("fixed_push_symlink_timestamp") FeatAbb = Feature("abb") FeatShellV2 = Feature("shell_v2") FeatCmd = Feature("cmd") FeatLsV2 = Feature("ls_v2") FeatApex = Feature("apex") FeatStatV2 = Feature("stat_v2") )
View Source
var DefaultAdbReadTimeout time.Duration = 60
View Source
var ErrConnBroken = errors.New("socket connection broken")
Functions ¶
func DisableTimeWait ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) DeviceList ¶
func (Client) DeviceSerialList ¶
func (Client) DisconnectAll ¶
func (Client) ForwardKillAll ¶
func (Client) ForwardList ¶
func (c Client) ForwardList() (deviceForward []DeviceForward, err error)
func (Client) KillServer ¶
func (Client) ServerVersion ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) DeviceInfo ¶
func (*Device) DevicePath ¶
func (*Device) EnableAdbOverTCP ¶
func (*Device) ForwardKill ¶
func (*Device) ForwardList ¶
func (d *Device) ForwardList() (deviceForwardList []DeviceForward, err error)
func (*Device) GetFeatures ¶
func (*Device) HasFeature ¶
func (*Device) InstallAPK ¶
func (d *Device) InstallAPK(apk io.ReadSeeker) (string, error)
func (*Device) List ¶
func (d *Device) List(remotePath string) (devFileInfos []DeviceFileInfo, err error)
func (*Device) ReverseForward ¶
func (*Device) ReverseForwardKill ¶
func (*Device) ReverseForwardKillAll ¶
func (*Device) ReverseForwardList ¶
func (d *Device) ReverseForwardList() (deviceForwardList []DeviceForward, err error)
func (*Device) RunShellCommand ¶
func (*Device) RunShellCommandV2 ¶
func (*Device) RunShellCommandV2WithBytes ¶
RunShellCommandV2WithBytes shell v2, 支持后台运行而不会阻断
func (*Device) RunShellCommandWithBytes ¶
func (*Device) State ¶
func (d *Device) State() (DeviceState, error)
type DeviceFileInfo ¶
func (DeviceFileInfo) IsDir ¶
func (info DeviceFileInfo) IsDir() bool
type DeviceForward ¶
type DeviceState ¶
type DeviceState string
const ( StateUnknown DeviceState = "UNKNOWN" StateOnline DeviceState = "online" StateOffline DeviceState = "offline" StateDisconnected DeviceState = "disconnected" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.