adb

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ADBInstallPath

func ADBInstallPath(ctx context.Context, run components.Runner, log logger.Logger) (string, error)

ADBInstallPath returns adb installation path.

func ADBVersion

func ADBVersion(ctx context.Context, run components.Runner, log logger.Logger) (string, error)

ADBVersion returns adb version number.

func CheckADBVendorKey

func CheckADBVendorKey(ctx context.Context, run components.Runner, log logger.Logger, vendorKey string) error

CheckADBVendorKey checks adb vendor private key.

func ConnectToWiFiNetwork

func ConnectToWiFiNetwork(ctx context.Context, retryInterval, timeout time.Duration, run components.Runner, log logger.Logger, serialNumber string, wifiSSID string, wifiSecurityType string, wifiPassword string) error

ConnectToWiFiNetwork connects DUT to WiFi network.

func EnableDeviceTestHarnessMode

func EnableDeviceTestHarnessMode(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

EnableDeviceTestHarnessMode resets device (https://developer.android.com/studio/command-line/adb#test_harness).

func EnableWiFi

func EnableWiFi(ctx context.Context, retryInterval, timeout time.Duration, run components.Runner, log logger.Logger, serialNumber string) error

EnableWiFi enables WiFi on DUT.

func GetDevicePath

func GetDevicePath(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) (string, error)

GetDevicePath reads device path.

func GetDeviceUSBFilename

func GetDeviceUSBFilename(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) (string, error)

GetDeviceUSBFilename returns device USB filename (e.g. /dev/bus/usb/001/030).

func GetDeviceUSBPath

func GetDeviceUSBPath(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) (string, error)

GetDeviceUSBPath returns device USB path (e.g. usb:1-6.1.1.3.3).

func IsDebuggableBuildOnDevice

func IsDebuggableBuildOnDevice(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

IsDebuggableBuildOnDevice checks whether device has application debugging enabled or not.

func IsDeviceAccessible

func IsDeviceAccessible(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

IsDeviceAccessible verifies that DUT is accessible through the associated host.

func IsDeviceRooted

func IsDeviceRooted(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

IsDeviceRooted validates whether device is rooted. Refer to go/abp-security/rooted-devices for info on device rooting.

func IsSecureBuildOnDevice

func IsSecureBuildOnDevice(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

IsSecureBuildOnDevice checks whether device has userdebug or user build. More details on https://source.android.com/source/add-device.html#build-variants

func KillADBServer

func KillADBServer(ctx context.Context, run components.Runner, log logger.Logger) error

KillADBServer kills adb server if it is running.

func RebootDevice

func RebootDevice(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

RebootDevice reboots device.

func RemoveScreenLock

func RemoveScreenLock(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

RemoveScreenLock disables screen lock on device and removes locksettings db.

func ResetADBDPublicKey

func ResetADBDPublicKey(ctx context.Context, run components.Runner, log logger.Logger, serialNumber, publicKeyFile, publicKey string) error

ResetADBDPublicKey restores adb public key if it is missing or not matching the given key.

func ResetUsbDevice

func ResetUsbDevice(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

ResetUsbDevice resets USB device.

func RestartADBDAsRoot

func RestartADBDAsRoot(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

RestartADBDAsRoot restarts adbd on device with root permissions.

func StartADBServer

func StartADBServer(ctx context.Context, run components.Runner, log logger.Logger, vendorKey string) error

StartADBServer ensures that there is adb server running.

func UnrootADBD

func UnrootADBD(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) error

UnrootADBD restarts adbd on device without root permissions.

func WaitForDeviceState

func WaitForDeviceState(ctx context.Context, expectedState State, stateCount int, waitTimeout time.Duration, run components.Runner, log logger.Logger, serialNumber string) error

WaitForDeviceState waits until the device gets into the expected state.

Types

type State

type State int
const (
	Unknown State = iota
	Offline
	Bootloader
	Device
	Unauthorized
)

func GetDeviceState

func GetDeviceState(ctx context.Context, run components.Runner, log logger.Logger, serialNumber string) (State, error)

GetDeviceState reads device state (offline | bootloader | device).

func (State) String

func (e State) String() string

Jump to

Keyboard shortcuts

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