ios

package
v0.0.0-...-efd23c5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package ios exposes routines for communicating with locally attached iOS devices via libidevicemobile CLI tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IOS

type IOS interface {
	Reboot(ctx context.Context) error
	OSVersion(ctx context.Context) (string, error)
	DeviceType(ctx context.Context) (string, error)
	BatteryLevel(ctx context.Context) (int, error)
}

type IOSImpl

type IOSImpl struct{}

We began attaching all our methods to an interface/struct only so we could mock the whole thing out. This was before we could mock out CLI invocations using Contexts.

func New

func New() IOSImpl

func (IOSImpl) BatteryLevel

func (ios IOSImpl) BatteryLevel(ctx context.Context) (int, error)

BatteryLevel returns the battery-full percentage of the attached device, or BadBatteryLevel if an error occurs.

func (IOSImpl) DeviceType

func (ios IOSImpl) DeviceType(ctx context.Context) (string, error)

DeviceType returns the Apple model identifier of the attached iDevice, e.g. "iPhone10,1".

func (IOSImpl) OSVersion

func (ios IOSImpl) OSVersion(ctx context.Context) (string, error)

OSVersion returns the version of iOS (or iPadOS, etc.) running on the attached device, e.g. "13.3.1".

func (IOSImpl) Reboot

func (ios IOSImpl) Reboot(ctx context.Context) error

Reboot restarts an arbitrary attached iOS device. (We never have more than one attached in practice.)

Jump to

Keyboard shortcuts

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