adb

package module
v0.0.0-...-f96f71a Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 14 Imported by: 0

README

goadb

A simple operation adb command library for Golang.

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
}

func GetClient

func GetClient() *Client

func (*Client) Connect

func (a *Client) Connect(ip string, port int64) (string, error)

Connect adb connect

func (*Client) Forward

func (a *Client) Forward(f *Forward) (bool, error)

Forward adb forward

func (*Client) ForwardList

func (a *Client) ForwardList() ([]*Forward, error)

ForwardList adb forward --list

func (*Client) GetApkAbi

func (a *Client) GetApkAbi(serial, packageName string) string

GetApkAbi get apk abi

func (*Client) GetApkPath

func (a *Client) GetApkPath(serial, packageName string) (string, error)

GetApkPath get apk installed path (com.r2studio.robotmon)

func (*Client) GetAppProcess

func (a *Client) GetAppProcess(serial string) (bool, bool, bool)

GetAppProcess for robotmon starting service

func (*Client) GetDeviceABI

func (a *Client) GetDeviceABI(serial string) (string, error)

GetDeviceABI get device abi, arm64-v8a, armeabi-v7a or x86

func (*Client) GetDevices

func (a *Client) GetDevices() ([]string, error)

GetDevices adb devices

func (*Client) GetIPAddress

func (a *Client) GetIPAddress(serial string) string

func (*Client) GetPids

func (a *Client) GetPids(serial string, process string) ([]string, error)

GetPids adb shell "ps | grep process" (app_process)

func (*Client) GetRobotmonStartCommand

func (a *Client) GetRobotmonStartCommand(serial string) (string, []string, error)

GetRobotmonStartCommand getRobotmonStartCommand

func (*Client) Init

func (a *Client) Init()

Init adb path

func (*Client) Install

func (a *Client) Install(serial, apk string) (string, error)

Install adb install

func (*Client) IsFileExist

func (a *Client) IsFileExist(serial, path string) bool

IsFileExist check is file exist in device

func (*Client) Restart

func (a *Client) Restart()

Restart adb kill-server then adb start-server

func (*Client) Shell

func (a *Client) Shell(serial, command string) (string, error)

Shell adb shell

func (*Client) StartRobotmonService

func (a *Client) StartRobotmonService(serial string) ([]string, error)

func (*Client) StopService

func (a *Client) StopService(serial string) error

func (*Client) TCPIP

func (a *Client) TCPIP(serial, port string) error

TCPIP adb tcpip

func (*Client) Uninstall

func (a *Client) Uninstall(serial, apkID string) (string, error)

Uninstall adb uninstall

type Forward

type Forward struct {
	Serial     string
	LocalPort  int64
	DevicePort int64
}

Jump to

Keyboard shortcuts

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