ios

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package ios configures iOS simulators and devices for HTTPS interception. Simulator CA install is automated via xcrun simctl; physical devices use a generated .mobileconfig (proxy + CA) the operator installs in Safari.

Index

Constants

View Source
const (
	KindSimulator = "simulator"
	KindPhysical  = "physical"
)

DeviceKind distinguishes simulators from USB-connected iPhones.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether any automated iOS backend exists on this machine.

func BuildMobileConfig

func BuildMobileConfig(certPEM []byte, opts ProfileOpts) ([]byte, error)

BuildMobileConfig returns a .mobileconfig plist installing the CA and manual HTTP proxy.

func IDeviceAvailable

func IDeviceAvailable() bool

IDeviceAvailable reports whether libimobiledevice is on PATH.

func InstallCASimulator

func InstallCASimulator(d Device, certPEM []byte) error

InstallCASimulator adds the Interceptor CA to a simulator trust store.

func LANHost

func LANHost() (string, error)

LANHost returns a likely private LAN IPv4 (shared helper for Wi‑Fi proxy).

func OpenURL

func OpenURL(d Device, rawURL string) error

OpenURL opens a URL in the simulator (e.g. profile install page).

func SimctlAvailable

func SimctlAvailable() bool

SimctlAvailable reports whether Xcode simctl is usable (macOS only).

Types

type Device

type Device struct {
	Kind            string `json:"kind"`
	UDID            string `json:"udid"`
	Name            string `json:"name"`
	State           string `json:"state,omitempty"`
	Runtime         string `json:"runtime,omitempty"`
	Booted          bool   `json:"booted,omitempty"`
	SuggestedTarget string `json:"suggestedTarget,omitempty"` // simulator | physical
}

Device is a simulator or USB-connected iOS device.

func AllDevices

func AllDevices() ([]Device, error)

AllDevices returns simulators then physical devices.

func PhysicalDevices

func PhysicalDevices() ([]Device, error)

PhysicalDevices lists USB-connected iOS devices via idevice_id.

func ResolveDevice

func ResolveDevice(udid string, devices []Device) (Device, error)

ResolveDevice picks explicit udid or the sole booted simulator / connected phone.

func Simulators

func Simulators() ([]Device, error)

Simulators lists iOS simulators (booted ones first).

type ProfileOpts

type ProfileOpts struct {
	DisplayName  string
	ProxyHost    string
	ProxyPort    int
	Organization string
}

ProfileOpts configures an unsigned configuration profile (CA + global HTTP proxy).

type SetupOpts

type SetupOpts struct {
	Target     string // simulator | physical | auto
	ProxyMode  string // localhost (simulator) | wifi (physical, default)
	WiFiHost   string
	Port       int
	ProfileURL string // control plane URL prefix for profile download
}

SetupOpts configures one-click iOS intercept setup.

type SetupResult

type SetupResult struct {
	UDID            string   `json:"udid"`
	Kind            string   `json:"kind"`
	Proxy           string   `json:"proxy,omitempty"`
	ProfileURL      string   `json:"profileUrl,omitempty"`
	Steps           []string `json:"steps"`
	NeedsUserAction bool     `json:"needsUserAction,omitempty"`
	Message         string   `json:"message"`
}

SetupResult is returned from Setup.

func Setup

func Setup(d Device, certPEM []byte, opts SetupOpts) (*SetupResult, error)

Setup automates what iOS allows: simulator CA via simctl; all targets get a profile URL.

Jump to

Keyboard shortcuts

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