appservice

package
v1.0.129 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package appservice provides functions to Launch and Kill apps on an iOS devices for iOS17+.

Index

Constants

View Source
const (
	// RebootFull is the style for a full reboot of the device.
	RebootFull = "full"
	// RebootUserspace is the style for a reboot of the userspace of the device.
	RebootUserspace = "userspace"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

Connection represents a connection to the appservice on an iOS device for iOS17+. It is used to launch and kill apps and to list processes.

func New

func New(deviceEntry ios.DeviceEntry) (*Connection, error)

New creates a new connection to the appservice on the device for iOS17+. It returns an error if the connection could not be established.

func (*Connection) Close

func (c *Connection) Close() error

Close closes the connection to the appservice

func (*Connection) KillProcess

func (c *Connection) KillProcess(pid int) error

KillProcess kills the process with the given PID for iOS17+.

func (*Connection) LaunchApp

func (c *Connection) LaunchApp(bundleId string, args []interface{}, env map[string]interface{}, options map[string]interface{}, terminateExisting bool) (int, error)

LaunchApp launches an app on the device with the given bundleId and arguments for iOS17+. On a successful launch it returns the PID of the launched process.

func (*Connection) LaunchAppWithStdIo

func (c *Connection) LaunchAppWithStdIo(bundleId string, args []interface{}, env map[string]interface{}, options map[string]interface{}, terminateExisting bool) (LaunchedAppWithStdIo, error)

LaunchAppWithStdIo launches an app and connects to the stdio-socket the returned value implements the io.ReadWriteCloser interface and needs to be closed when finished using the stdio-socket

func (*Connection) ListProcesses

func (c *Connection) ListProcesses() ([]Process, error)

ListProcesses returns a list of processes with their PID and executable path running on the device for iOS17+.

func (*Connection) Reboot

func (c *Connection) Reboot() error

Reboot performs a full reboot of the device for iOS17+. Just calls RebootWithStyle with RebootFull.

func (*Connection) RebootWithStyle

func (c *Connection) RebootWithStyle(style string) error

RebootWithStyle performs a reboot of the device with the given style for iOS17+. For style use RebootFull or RebootUserSpace.

type LaunchedAppWithStdIo

type LaunchedAppWithStdIo struct {
	Pid int
	// contains filtered or unexported fields
}

LaunchedAppWithStdIo is the launched app with a connection to the stdio-socket

func (LaunchedAppWithStdIo) Close

func (a LaunchedAppWithStdIo) Close() error

Close closes the connection to stdio-socket of the launched app

func (LaunchedAppWithStdIo) Read

func (a LaunchedAppWithStdIo) Read(p []byte) (n int, err error)

Read reads from the stdio socket of the launched app

func (LaunchedAppWithStdIo) Write

func (a LaunchedAppWithStdIo) Write(p []byte) (n int, err error)

Write reads from the stdio socket of the launched app

type Process

type Process struct {
	Pid  int
	Path string
}

Process represents a process running on the device for iOS17+. It contains the PID and the path of the process.

func (Process) ExecutableName

func (p Process) ExecutableName() string

ExecutableName returns the executable name for a process by removing the path.

Jump to

Keyboard shortcuts

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