Documentation
¶
Index ¶
- func IsLevelInScope(entryLevel string, wantedLevel string) bool
- type AdbLineEntry
- type Client
- func (client *Client) CheckConn() (err error)
- func (client *Client) ClearLogcatOutput() (err error)
- func (client *Client) GetCurrentApp() (slug string, err error)
- func (client *Client) GetPID(slug string) (pid string, err error)
- func (client *Client) GetProcesses() (processes []*Process, err error)
- func (client *Client) ListAllPackages() (packages []string, err error)
- func (client *Client) ListDevices() (devices []string, err error)
- func (client *Client) ListThirdPartyPackages() (packages []string, err error)
- func (client *Client) Run(timeoutSeconds int, args ...string) (string, error)
- type LogcatOptions
- type Process
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLevelInScope ¶
Checks if the level is higher or the same as the wanted one
Types ¶
type AdbLineEntry ¶
type AdbLineEntry struct {
Date string
Time string
Level string
Tag string
PID string
TID string
Message string
}
The struct to represent a logcat line
func ParseLogcatLine ¶
func ParseLogcatLine(line string) (entry AdbLineEntry, err error)
Parses a logcat line into a LogcatEntry struct
func (AdbLineEntry) EqualTimePidLevel ¶
func (entry AdbLineEntry) EqualTimePidLevel(e2 *AdbLineEntry) bool
type Client ¶
type Client struct {
ADBPath string // Path to the ADB binary like /path/to/adb
BaseCmd []string // Base command like /path/to/adb -d
BaseCmdLogcat []string // Base logcat command like /path/to/adb -d logcat
}
func NewClient ¶
Creates a new ADB client with the passed binPath like '/path/to/adb' and the connectionStr like '-d'
func (*Client) ClearLogcatOutput ¶
Clears the logcat output via 'logcat -c'
func (*Client) GetCurrentApp ¶
Returns the slug (com.example.app) of the app in the foreground via 'adb shell dumsys'
func (*Client) GetPID ¶
Returns the PID of the passed app identified by its slug (com.example.app)
If no process is matched, an error is returned
func (*Client) GetProcesses ¶
Runs 'adb shell ps' and parses the output into a custom struct
func (*Client) ListAllPackages ¶
Returns a list of all packages installed on the device via 'adb shell pm list packages'
func (*Client) ListDevices ¶ added in v0.1.2
Returns a list of all packages installed on the device via 'adb shell pm list packages'
func (*Client) ListThirdPartyPackages ¶
Returns a list of all third party packages installed on the device via 'adb shell pm list packages -3'