instruments

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyProfileAndType added in v1.0.24

func VerifyProfileAndType(types []ProfileType, profileTypeIdentifier string, profileIdentifier string) (ProfileType, Profile, error)

VerifyProfileAndType checks that the given string profileTypeIdentifier and profileIdentifier are contained in the given types.

Types

type DeviceInfoService added in v1.0.7

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

DeviceInfoService gives us access to retrieving process lists and resolving names for PIDs

func NewDeviceInfoService added in v1.0.7

func NewDeviceInfoService(device ios.DeviceEntry) (*DeviceInfoService, error)

NewDeviceInfoService creates a new DeviceInfoService for a given device

func (*DeviceInfoService) Close added in v1.0.7

func (d *DeviceInfoService) Close()

Close closes up the DTX connection

func (DeviceInfoService) NameForPid added in v1.0.7

func (d DeviceInfoService) NameForPid(pid uint64) error

NameForPid resolves a process name for a given pid

func (DeviceInfoService) ProcessList added in v1.0.7

func (d DeviceInfoService) ProcessList() ([]ProcessInfo, error)

ProcessList returns a []ProcessInfo, one for each process running on the iOS device

type DeviceStateControl added in v1.0.24

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

DeviceStateControl allows to access the ConditionInducer so we can set device states like

"SlowNetworkCondition"  and  "SlowNetwork3GGood".

Use the List() command to get all available ProfileType and Profile combinations. Then use Enable() and Disable() to control them.

func NewDeviceStateControl added in v1.0.24

func NewDeviceStateControl(device ios.DeviceEntry) (*DeviceStateControl, error)

NewDeviceStateControl creates and connects a new DeviceStateControl that is ready to use

func (DeviceStateControl) Disable added in v1.0.24

func (d DeviceStateControl) Disable(pType ProfileType) error

Disable deactivates the currently active profileType

func (DeviceStateControl) Enable added in v1.0.24

func (d DeviceStateControl) Enable(pType ProfileType, profile Profile) error

Enable activates a given profileType and profile received from a List command. Note, that the device will automatically deactivate the profile if this dtx connection closes f.ex. when the process is terminated. Make sure to keep it open if you use this and use the Disable command.

func (DeviceStateControl) List added in v1.0.24

func (d DeviceStateControl) List() ([]ProfileType, error)

List returns a list of all available profile types and profiles.

type ProcessControl

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

func NewProcessControl

func NewProcessControl(device ios.DeviceEntry) (*ProcessControl, error)

func (*ProcessControl) Close

func (p *ProcessControl) Close()

func (ProcessControl) KillProcess

func (p ProcessControl) KillProcess(pid uint64) error

KillProcess kills the process on the device.

func (*ProcessControl) LaunchApp

func (p *ProcessControl) LaunchApp(bundleID string) (uint64, error)

LaunchApp launches the app with the given bundleID on the given device.LaunchApp Use LaunchAppWithArgs for passing arguments and envVars. It returns the PID of the created app process.

func (ProcessControl) StartProcess

func (p ProcessControl) StartProcess(bundleID string, envVars map[string]interface{}, arguments []interface{}, options map[string]interface{}) (uint64, error)

StartProcess launches an app on the device using the bundleID and optional envvars, arguments and options. It returns the PID.

type ProcessInfo added in v1.0.7

type ProcessInfo struct {
	IsApplication bool
	Name          string
	Pid           uint64
	RealAppName   string
	StartDate     time.Time
}

ProcessInfo contains all the properties for a process running on an iOS devices that we get back from instruments

type Profile added in v1.0.24

type Profile struct {
	Description string
	Identifier  string
	Name        string
}

Profile belongs to a ProfileType

type ProfileType added in v1.0.24

type ProfileType struct {
	ActiveProfile  string
	Identifier     string
	ProfilesSorted bool
	IsActive       bool
	Name           string
	IsDestructive  bool
	IsInternal     bool
	Profiles       []Profile
}

ProfileType a profile type we can activate

Jump to

Keyboard shortcuts

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