adb

package
v0.0.0-...-d850389 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package adb is a simple wrapper around calling adb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adb

type Adb interface {
	// EnsureOnline returns nil if the Android device is online and ready to
	// run, otherwise it will try to bring it back online and if that fails will
	// return an error.
	EnsureOnline(ctx context.Context) error

	// RawProperties returns the unfiltered output of running "adb shell getprop".
	RawProperties(ctx context.Context) (string, error)

	// RawDumpSys returns the unfiltered output of running "adb shell dumpsys <service>".
	RawDumpSys(ctx context.Context, service string) (string, error)

	// Reboot the device.
	Reboot(ctx context.Context) error

	// Uptime returns how long the device has been awake since its last reboot.
	Uptime(ctx context.Context) (time.Duration, error)
}

Adb is the interface that AdbImpl provides.

type AdbImpl

type AdbImpl struct{}

AdbImpl handles talking to the adb process.

func New

func New() AdbImpl

New returns a new Adb.

func (AdbImpl) EnsureOnline

func (a AdbImpl) EnsureOnline(ctx context.Context) error

EnsureOnline implements the Adb interface.

func (AdbImpl) RawDumpSys

func (a AdbImpl) RawDumpSys(ctx context.Context, service string) (string, error)

RawDumpSys implements the Adb interface.

func (AdbImpl) RawProperties

func (a AdbImpl) RawProperties(ctx context.Context) (string, error)

RawProperties implements the Adb interface.

func (AdbImpl) Reboot

func (a AdbImpl) Reboot(ctx context.Context) error

Reboot implements the Adb interface.

func (AdbImpl) Uptime

func (a AdbImpl) Uptime(ctx context.Context) (time.Duration, error)

Uptime implements the Adb interface.

Jump to

Keyboard shortcuts

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