adbclient

package module
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 24 Imported by: 0

README

go_adb_client

Go adb client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitAndReturnOutput added in v1.0.29

func WaitAndReturnOutput(result *process.OutputResult, err error, timeout time.Duration) (process.OutputResult, error)

Types

type Client

type Client struct {
	Conn    *connection.Connection
	Mdns    *mdns.Mdns
	Channel chan rxgo.Item
	Address types.Serial
	Shell   *shell.Shell
}

func NewClient

func NewClient(device types.Serial, logger *log.Logger, verbose bool) *Client

func NullClient added in v0.0.2

func NullClient(verbose bool) *Client

func (Client) BugReport

func (c Client) BugReport(dst string) (process.OutputResult, error)

BugReport ExecuteWithTimeout and return the result of the command 'adb bugreport' dst: optional target local folder/filename for the bugreport

func (Client) ClearLogcat added in v1.0.28

func (c Client) ClearLogcat() error

func (Client) Connect

func (c Client) Connect(timeout time.Duration) (process.OutputResult, error)

func (Client) DeferredDispatch

func (c Client) DeferredDispatch(eventType events.EventType)

func (Client) DisableVerity added in v1.0.44

func (c Client) DisableVerity() error

func (Client) Disconnect

func (c Client) Disconnect() (process.OutputResult, error)

func (Client) DisconnectAll

func (c Client) DisconnectAll() (process.OutputResult, error)

func (Client) Dispatch

func (c Client) Dispatch(eventType events.EventType, data interface{})

func (Client) EnableVerity added in v1.0.44

func (c Client) EnableVerity() error

func (Client) GetIsConnected added in v0.0.5

func (c Client) GetIsConnected() bool

func (Client) GetIsRoot added in v0.0.5

func (c Client) GetIsRoot() bool

func (Client) GetMemInfo added in v1.0.45

func (c Client) GetMemInfo() (map[string]int, error)

func (Client) Install

func (c Client) Install(src string, options *InstallOptions) (process.OutputResult, error)

func (Client) IsConnected

func (c Client) IsConnected() (bool, error)

func (Client) IsRoot

func (c Client) IsRoot() (bool, error)

func (Client) ListDevices

func (c Client) ListDevices() ([]*types.Device, error)

func (Client) Logcat added in v0.0.2

func (c Client) Logcat(options types.LogcatOptions) (process.OutputResult, error)

func (Client) LogcatPipe added in v1.0.29

func (c Client) LogcatPipe(options types.LogcatOptions) (*processbuilder.Processbuilder, error)

func (Client) Mount

func (c Client) Mount(dir string) (process.OutputResult, error)

func (Client) MustRoot added in v0.0.5

func (c Client) MustRoot() bool

func (Client) NewAdbCommand added in v1.0.29

func (c Client) NewAdbCommand() *process.ADBCommand

func (Client) Pull

func (c Client) Pull(src string, dst string) (process.OutputResult, error)

Pull a file from the device. src is the file to be pulled from the device. dst is the destination filepath on the host.

func (Client) Push

func (c Client) Push(src string, dst string) (process.OutputResult, error)

Push a file to the connected device. src is the host file to be pushed. dst is the target device where the file should be pushed to.

func (Client) Reboot

func (c Client) Reboot() (process.OutputResult, error)

func (Client) Reconnect

func (c Client) Reconnect(t types.ReconnectType, timeout time.Duration) (process.OutputResult, error)

func (Client) Remount

func (c Client) Remount() (process.OutputResult, error)

func (Client) Root

func (c Client) Root() error

func (Client) UnRoot

func (c Client) UnRoot() error

func (Client) Uninstall

func (c Client) Uninstall(packageName string) (process.OutputResult, error)

func (Client) Unmount

func (c Client) Unmount(dir string) (process.OutputResult, error)

func (Client) WaitForDevice

func (c Client) WaitForDevice(timeout time.Duration) (process.OutputResult, error)

type Device

type Device struct {
	Client *Client
}

func NewDevice

func NewDevice(client *Client) *Device

func (Device) ActivityManager

func (d Device) ActivityManager() *activitymanager.ActivityManager

func (Device) ApiLevel

func (d Device) ApiLevel() *string

func (Device) IsScreenOn

func (d Device) IsScreenOn() (bool, error)

IsScreenOn Return true if the device screen is on

func (Device) Name

func (d Device) Name() *string

func (Device) PackageManager

func (d Device) PackageManager() *packagemanager.PackageManager

func (Device) Power

func (d Device) Power() (bool, error)

Power Send a KEYCODE_POWER input event to the device

func (Device) PowerOff

func (d Device) PowerOff() (bool, error)

PowerOff Power off the device (turn the screen off). If the screen is already off it returns false, true otherwise

func (Device) PowerOffOn added in v1.0.26

func (d Device) PowerOffOn() (bool, error)

PowerOffOn send the power button input key

func (Device) PowerOn

func (d Device) PowerOn() (bool, error)

PowerOn Power on the device (turn the screen off). If the screen is already on it returns false, true otherwise

func (Device) SaveScreenCap

func (d Device) SaveScreenCap(output string) (process.OutputResult, error)

func (Device) Version

func (d Device) Version() *string

func (Device) WriteScreenCap

func (d Device) WriteScreenCap(output *os.File) (process.OutputResult, error)

type InstallOptions

type InstallOptions struct {
	// -r reinstall an existing app, keeping its data
	KeepData bool
	// -t allow test packages
	AllowTestPackages bool
	// -d allow version code downgrade
	AllowDowngrade bool
	// -g grant all runtime permissions
	GrantPermissions bool
}

Directories

Path Synopsis
util

Jump to

Keyboard shortcuts

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