adb

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: BSD-3-Clause Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Common install and uninstall errors
	ErrInternalError  = errors.New("internal error")
	ErrUserRestricted = errors.New("user restricted")
	ErrAborted        = errors.New("aborted")

	// Install errors
	ErrAlreadyExists            = errors.New("already exists")
	ErrInvalidApk               = errors.New("invalid apk")
	ErrInvalidURI               = errors.New("invalid uri")
	ErrInsufficientStorage      = errors.New("insufficient storage")
	ErrDuplicatePackage         = errors.New("duplicate package")
	ErrNoSharedUser             = errors.New("no shared user")
	ErrUpdateIncompatible       = errors.New("update incompatible")
	ErrSharedUserIncompatible   = errors.New("shared user incompatible")
	ErrMissingSharedLibrary     = errors.New("missing shared library")
	ErrReplaceCouldntDelete     = errors.New("replace couldn't delete")
	ErrDexopt                   = errors.New("dexopt")
	ErrOlderSdk                 = errors.New("older sdk")
	ErrConflictingProvider      = errors.New("conflicting provider")
	ErrNewerSdk                 = errors.New("newer sdk")
	ErrTestOnly                 = errors.New("test only")
	ErrCPUAbiIncompatible       = errors.New("cpu abi incompatible")
	ErrMissingFeature           = errors.New("missing feature")
	ErrContainerError           = errors.New("combiner error")
	ErrInvalidInstallLocation   = errors.New("invalid install location")
	ErrMediaUnavailable         = errors.New("media unavailable")
	ErrVerificationTimeout      = errors.New("verification timeout")
	ErrVerificationFailure      = errors.New("verification failure")
	ErrPackageChanged           = errors.New("package changed")
	ErrUIDChanged               = errors.New("uid changed")
	ErrVersionDowngrade         = errors.New("version downgrade")
	ErrNotApk                   = errors.New("not apk")
	ErrBadManifest              = errors.New("bad manifest")
	ErrUnexpectedException      = errors.New("unexpected exception")
	ErrNoCertificates           = errors.New("no certificates")
	ErrInconsistentCertificates = errors.New("inconsistent certificates")
	ErrCertificateEncoding      = errors.New("certificate encoding")
	ErrBadPackageName           = errors.New("bad package name")
	ErrBadSharedUserID          = errors.New("bad shared user id")
	ErrManifestMalformed        = errors.New("manifest malformed")
	ErrManifestEmpty            = errors.New("manifest empty")
	ErrDuplicatePermission      = errors.New("duplicate permission")
	ErrNoMatchingAbis           = errors.New("no matching abis")

	// Uninstall errors
	ErrDevicePolicyManager = errors.New("device policy manager")
	ErrOwnerBlocked        = errors.New("owner blocked")
)

Functions

func AdbPropFallback added in v0.6.0

func AdbPropFallback(device *Device, props map[string]string, property string) (string, error)

func AllUserIds added in v0.7.0

func AllUserIds(installed map[string]Package) map[int]struct{}

func IsServerRunning

func IsServerRunning() bool

func StartServer

func StartServer() error

Types

type Device

type Device struct {
	ID       string
	Usb      string
	Product  string
	Model    string
	Device   string
	ABIs     []string
	APILevel int
}

func Devices

func Devices() ([]*Device, error)

func (*Device) AdbCmd

func (d *Device) AdbCmd(args ...string) *exec.Cmd

func (*Device) AdbProp added in v0.6.0

func (d *Device) AdbProp(property string) (string, error)

func (*Device) AdbProps added in v0.3.0

func (d *Device) AdbProps() (map[string]string, error)

func (*Device) AdbShell

func (d *Device) AdbShell(args ...string) *exec.Cmd

func (*Device) CurrentUserId added in v0.7.0

func (d *Device) CurrentUserId() (int, error)

func (*Device) Install

func (d *Device) Install(path string) error

func (*Device) InstallUser added in v0.6.0

func (d *Device) InstallUser(path, user string) error

func (*Device) Installed

func (d *Device) Installed() (map[string]Package, error)

func (*Device) Uninstall

func (d *Device) Uninstall(pkg string) error

func (*Device) UninstallUser added in v0.7.0

func (d *Device) UninstallUser(pkg, user string) error

type Package

type Package struct {
	ID                   string
	VersCode             int
	VersName             string
	IsSystem             bool
	InstalledForUsers    []int
	NotInstalledForUsers []int
}

Jump to

Keyboard shortcuts

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