simulator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package simulator finds booted iOS Simulators and installs pano's root CA into their trust stores.

The Simulator shares the Mac's network stack, so `pano on` already routes its traffic — decryption is the only missing piece, because each simulator keeps its own trust store (the Mac's keychain does not apply). Since Xcode 12.5 the supported way in is Xcode's own CLI:

xcrun simctl keychain <udid> add-root-cert <ca.pem>

which lands the certificate directly in the trusted root store — no Settings toggle, unlike a physical iPhone. A reboot of the simulator makes running apps pick it up.

pano never installs by itself: it detects and suggests, the user confirms (`pano ca install --simulator`, or one key in the TUI). A state file remembers which simulators already have the current CA — and which asked not to be suggested again — so the suggestion appears only when useful.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	UDID    string `json:"udid"`
	Name    string `json:"name"`    // "iPhone 17"
	Runtime string `json:"runtime"` // "iOS 26.4"
}

Device is one booted simulator.

func (Device) Label

func (d Device) Label() string

Label renders the device for humans: "iPhone 17 (iOS 26.4)".

type Manager

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

Manager detects simulators and installs the CA. Safe for concurrent use in the read paths; Install/Dismiss serialise on the state file via WriteAtomic.

func New

func New(certPath, statePath string) *Manager

New returns a Manager for pano's CA at certPath, remembering installs in statePath (normally config.Paths.SimulatorState()).

func (*Manager) Booted

func (m *Manager) Booted(ctx context.Context) ([]Device, error)

Booted lists the simulators that are running right now.

func (*Manager) Dismiss

func (m *Manager) Dismiss(devs []Device) error

Dismiss records that these simulators must not be suggested again.

func (*Manager) Install

func (m *Manager) Install(ctx context.Context, d Device) error

Install adds pano's CA to the simulator's trusted root store and records it. Running apps see it after a reboot of the simulator.

func (*Manager) Reboot

func (m *Manager) Reboot(ctx context.Context, d Device) error

Reboot shuts the simulator down and boots it again so apps pick up the freshly trusted certificate.

func (*Manager) Suggest

func (m *Manager) Suggest(ctx context.Context) []Device

Suggest returns the booted simulators worth offering an install for: the current CA is not recorded as installed and the simulator was not dismissed. It is best-effort — any failure returns nil devices.

func (*Manager) Supported

func (m *Manager) Supported() bool

Supported reports whether xcrun exists (Xcode or its Command Line Tools).

Jump to

Keyboard shortcuts

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