devicectl

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package devicectl provides wrappers around xcrun devicectl for physical device management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceInfo

func DeviceInfo(ctx context.Context, identifier string) (map[string]any, error)

DeviceInfo returns detailed information about a specific device.

func InstallApp

func InstallApp(ctx context.Context, identifier, appPath string) error

InstallApp installs an application bundle on a physical device.

func LaunchApp

func LaunchApp(ctx context.Context, identifier, bundleID string) error

LaunchApp launches an application on a physical device.

func RebootDevice

func RebootDevice(ctx context.Context, identifier string) error

RebootDevice reboots a physical device.

func TerminateApp

func TerminateApp(ctx context.Context, identifier, bundleID string) error

TerminateApp terminates an application on a physical device.

func UninstallApp

func UninstallApp(ctx context.Context, identifier, bundleID string) error

UninstallApp uninstalls an application from a physical device.

Types

type Device

type Device struct {
	Identifier     string         `json:"identifier"`
	Name           string         `json:"name"`
	DeviceType     string         `json:"deviceType"`
	Platform       string         `json:"platform"`
	OSVersion      string         `json:"osVersion"`
	ConnectionType string         `json:"connectionType"`
	State          string         `json:"state"`
	Extra          map[string]any `json:"-"`
}

Device represents a physical iOS/macOS device.

func ListDevices

func ListDevices(ctx context.Context) ([]Device, error)

ListDevices returns all physical devices known to CoreDevice.

type DeviceListResult

type DeviceListResult struct {
	Result struct {
		Devices []struct {
			Identifier           string `json:"identifier"`
			Name                 string `json:"deviceProperties.name"`
			DeviceType           string `json:"hardwareProperties.deviceType"`
			Platform             string `json:"hardwareProperties.platform"`
			OSVersionNumber      string `json:"deviceProperties.osVersionNumber"`
			ConnectionProperties struct {
				TransportType string `json:"transportType"`
			} `json:"connectionProperties"`
		} `json:"devices"`
	} `json:"result"`
}

DeviceListResult is the JSON output from devicectl list devices.

Jump to

Keyboard shortcuts

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