Help us shape the future of Go! Take the 2026 Go Developer Survey

adb

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppDetailsCmd added in v0.2.0

func AppDetailsCmd(serial, pkg, apkPath string) tea.Cmd

AppDetailsCmd fetches version/target-sdk from dumpsys and the APK size for one package. Issued lazily for the selected app only.

func ClearAppDataCmd

func ClearAppDataCmd(serial, pkg string) tea.Cmd

func DefaultSaveDir added in v0.2.0

func DefaultSaveDir() string

DefaultSaveDir is where host-side files (screenshots, recordings, pulled files, logcat dumps, extracted APKs) are written: ~/Downloads when it exists, otherwise the home directory, falling back to the working directory. Built with filepath so it is correct on Windows, macOS, and Linux.

func DeleteFileCmd

func DeleteFileCmd(serial, path string) tea.Cmd

func EnsureAvailable added in v0.2.0

func EnsureAvailable() error

EnsureAvailable reports whether the adb binary can be found on PATH.

func ExecuteCommand

func ExecuteCommand(serial string, args ...string) ([]byte, error)

func ExtractApkCmd added in v0.2.0

func ExtractApkCmd(serial, apkPath, pkg string) tea.Cmd

ExtractApkCmd pulls an installed app's base APK to the host.

func FetchBatteryThermalCmd added in v0.2.0

func FetchBatteryThermalCmd(serial string) tea.Cmd

func FetchDeviceDetailsCmd

func FetchDeviceDetailsCmd(serial string) tea.Cmd

func ForceStopAppCmd

func ForceStopAppCmd(serial, pkg string) tea.Cmd

func FormatFileSize

func FormatFileSize(sizeStr string) string

func ForwardPortCmd added in v0.2.0

func ForwardPortCmd(serial, local, remote string) tea.Cmd

func GetProperty

func GetProperty(serial, prop string) (string, error)

func GetSystemStatsCmd

func GetSystemStatsCmd(serial string) tea.Cmd

func InstallAppCmd added in v0.2.0

func InstallAppCmd(serial, localApkPath string) tea.Cmd

func LaunchAppCmd

func LaunchAppCmd(serial, pkg string) tea.Cmd

func ListAppsCmd

func ListAppsCmd(serial string) tea.Cmd

func ListDevicesCmd

func ListDevicesCmd() tea.Cmd

func ListFilesCmd

func ListFilesCmd(serial, path string) tea.Cmd

func ListPortForwardsCmd added in v0.2.0

func ListPortForwardsCmd(serial string) tea.Cmd

func MakeDirCmd added in v0.2.0

func MakeDirCmd(serial, path string) tea.Cmd

func NextLogcatLineCmd

func NextLogcatLineCmd(s *LogcatSession) tea.Cmd

func PairWirelessCmd

func PairWirelessCmd(addr, port, pin string) tea.Cmd

func ParseLines

func ParseLines(data []byte) []string

func PullFileCmd

func PullFileCmd(serial, remotePath, localPath string) tea.Cmd

func PushFileCmd

func PushFileCmd(serial, localPath, remotePath string) tea.Cmd

func RebootBootloaderCmd

func RebootBootloaderCmd(serial string) tea.Cmd

func RebootCmd

func RebootCmd(serial string) tea.Cmd

func RebootRecoveryCmd

func RebootRecoveryCmd(serial string) tea.Cmd

func RemoveForwardCmd added in v0.2.0

func RemoveForwardCmd(serial, local string) tea.Cmd

func ResolvePidCmd added in v0.2.0

func ResolvePidCmd(serial, pkg string) tea.Cmd

ResolvePidCmd resolves a package name to its (single) running PID.

func ReversePortCmd added in v0.2.0

func ReversePortCmd(serial, remote, local string) tea.Cmd

func SaveLogcatCmd added in v0.2.0

func SaveLogcatCmd(lines []string) tea.Cmd

SaveLogcatCmd writes the given lines to a timestamped file in the default save dir.

func ScreenshotCmd added in v0.2.0

func ScreenshotCmd(serial string) tea.Cmd

ScreenshotCmd grabs a screenshot via `exec-out screencap -p`, which streams the raw PNG to stdout — avoiding the CRLF corruption shell redirection causes on Windows.

func SendBroadcastCmd added in v0.2.0

func SendBroadcastCmd(serial, action, extras string) tea.Cmd

func SendIntentCmd added in v0.2.0

func SendIntentCmd(serial, action, dataURI, extras string) tea.Cmd

func SendKeyEventCmd added in v0.2.0

func SendKeyEventCmd(serial string, keycode int) tea.Cmd

func SendTextCmd added in v0.2.0

func SendTextCmd(serial, text string) tea.Cmd

func StartLogcatCmd

func StartLogcatCmd(serial, pid string) tea.Cmd

StartLogcatCmd starts a logcat stream. When pid is non-empty the stream is limited to that process via --pid.

func StartScrcpyCmd

func StartScrcpyCmd(serial string) tea.Cmd

func StartScreenRecordCmd added in v0.2.0

func StartScreenRecordCmd(serial string) tea.Cmd

StartScreenRecordCmd launches screenrecord on the device, writing to /sdcard. The process is long-running and held in the returned session until stopped.

func StopScreenRecordCmd added in v0.2.0

func StopScreenRecordCmd(s *ScreenRecordSession) tea.Cmd

StopScreenRecordCmd interrupts the recording so the file is finalized, pulls it to the host, then removes the on-device copy.

func TimestampedName added in v0.2.0

func TimestampedName(prefix, ext string) string

TimestampedName builds a filename like "screenshot-20060102-150405.png".

func ToggleScreenCmd

func ToggleScreenCmd(serial string) tea.Cmd

func ToggleWifiCmd

func ToggleWifiCmd(serial string) tea.Cmd

func UninstallAppCmd

func UninstallAppCmd(serial, pkg string) tea.Cmd

Types

type App

type App struct {
	PackageName string
	APKPath     string
	IsSystem    bool
}

func ParseApps

func ParseApps(output []byte) []App

type AppActionErrorMsg

type AppActionErrorMsg struct {
	Action string
	Error  error
}

type AppActionResultMsg

type AppActionResultMsg struct {
	Action string
}

type AppDetails added in v0.2.0

type AppDetails struct {
	VersionName string
	VersionCode string
	TargetSdk   string
	Size        string
}

type AppDetailsMsg added in v0.2.0

type AppDetailsMsg struct {
	Pkg     string
	Details AppDetails
	Error   error
}

type AppsLoadErrorMsg

type AppsLoadErrorMsg struct {
	Error error
}

type AppsLoadedMsg

type AppsLoadedMsg struct {
	Apps []App
}

type BatteryThermal added in v0.2.0

type BatteryThermal struct {
	Level       string
	Status      string
	Temperature string
	Voltage     string
	Health      string
	Technology  string
	Plugged     string
	Zones       []ThermalZone
}

type BatteryThermalMsg added in v0.2.0

type BatteryThermalMsg struct {
	Data  BatteryThermal
	Error error
}

type CaptureResultMsg added in v0.2.0

type CaptureResultMsg struct {
	Action string // "screenshot" or "recording"
	Path   string
	Error  error
}

type Device

type Device struct {
	Serial  string
	Model   string
	State   string
	Android string
}

func (*Device) DisplayName

func (d *Device) DisplayName() string

func (*Device) IsConnected

func (d *Device) IsConnected() bool

type DeviceActionErrorMsg

type DeviceActionErrorMsg struct {
	Action string
	Error  error
}

type DeviceActionResultMsg

type DeviceActionResultMsg struct {
	Action string
}

type DeviceDetails

type DeviceDetails struct {
	BatteryLevel  string
	BatteryStatus string
	StorageUsed   string
	StorageTotal  string
	ScreenSize    string
	ScreenDensity string
	IPAddress     string
}

type DeviceDetailsMsg

type DeviceDetailsMsg struct {
	Details DeviceDetails
	Error   error
}

type DevicesLoadedMsg

type DevicesLoadedMsg struct {
	Devices []Device
	Error   error
}

type FileActionResultMsg

type FileActionResultMsg struct {
	Action string
	Error  error
}

type FileEntry

type FileEntry struct {
	Name        string
	Path        string
	IsDir       bool
	Size        string
	Permissions string
}

type FilesLoadedMsg

type FilesLoadedMsg struct {
	Path  string
	Files []FileEntry
	Error error
}

type InputResultMsg added in v0.2.0

type InputResultMsg struct {
	Error error
}

type IntentErrorMsg added in v0.2.0

type IntentErrorMsg struct {
	Error error
}

type IntentResultMsg added in v0.2.0

type IntentResultMsg struct {
	Output string
}

type LogcatErrorMsg

type LogcatErrorMsg struct {
	Session *LogcatSession
	Error   error
}

type LogcatLineMsg

type LogcatLineMsg struct {
	Session *LogcatSession
	Line    string
}

Line/Stopped/Error messages carry the session they came from so the UI can ignore stale output after the stream is restarted with a new filter.

type LogcatSavedMsg added in v0.2.0

type LogcatSavedMsg struct {
	Path  string
	Error error
}

type LogcatSession

type LogcatSession struct {
	// contains filtered or unexported fields
}

func (*LogcatSession) Stop added in v0.2.0

func (s *LogcatSession) Stop() error

type LogcatStartedMsg

type LogcatStartedMsg struct {
	Session *LogcatSession
}

type LogcatStoppedMsg

type LogcatStoppedMsg struct {
	Session *LogcatSession
}

type PairWirelessResultMsg

type PairWirelessResultMsg struct {
	Error error
}

type PidResolvedMsg added in v0.2.0

type PidResolvedMsg struct {
	Pkg   string
	Pid   string
	Error error
}

type PortActionErrorMsg added in v0.2.0

type PortActionErrorMsg struct {
	Action string
	Error  error
}

type PortActionResultMsg added in v0.2.0

type PortActionResultMsg struct {
	Action string
}

type PortForward added in v0.2.0

type PortForward struct {
	Serial string
	Local  string
	Remote string
}

type PortsLoadErrorMsg added in v0.2.0

type PortsLoadErrorMsg struct {
	Error error
}

type PortsLoadedMsg added in v0.2.0

type PortsLoadedMsg struct {
	Ports []PortForward
}

type ScreenRecordSession added in v0.2.0

type ScreenRecordSession struct {
	// contains filtered or unexported fields
}

type ScreenRecordStartedMsg added in v0.2.0

type ScreenRecordStartedMsg struct {
	Session *ScreenRecordSession
	Error   error
}

type SystemStats

type SystemStats struct {
	// CPU counters (jiffies)
	CPUTotal uint64
	CPUIdle  uint64

	// Memory info (kB)
	MemTotal     uint64
	MemUsed      uint64 // Total - Available
	MemAvailable uint64 // MemFree + Buffers + Cached (approx)

	// Network counters (bytes) - usually for wlan0 or total
	NetRxBytes uint64
	NetTxBytes uint64
}

SystemStats holds raw counters from /proc files. The UI layer is responsible for calculating rates/percentages by comparing with previous samples.

type SystemStatsMsg

type SystemStatsMsg struct {
	Stats SystemStats
	Error error
}

type ThermalZone added in v0.2.0

type ThermalZone struct {
	Type string
	Temp string
}

Jump to

Keyboard shortcuts

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