Documentation
¶
Index ¶
- Constants
- Variables
- func BootAndWait(ctx context.Context, set, udid string) error
- func CloneDevice(ctx context.Context, udid, name string) (newUDID string, err error)
- func DeleteDevice(ctx context.Context, udid string) error
- func DisableSlim(ctx context.Context, set, udid string, report Reporter) (bool, error)
- func EnableSlim(ctx context.Context, set, udid string, p Profile, report Reporter) (bool, error)
- func EraseDevice(ctx context.Context, udid string) error
- func ExtraDeviceSetTokens() []string
- func MarshalProfile(sp SlimProfile) ([]byte, error)
- func MeasureMany(ctx context.Context, udids []string) (map[string]Measurement, map[string]string)
- func NormalizeSimulatorName(name string) (string, error)
- func ProfileFileName(name string) string
- func RegisterDeviceSet(value string)
- func RenameDevice(ctx context.Context, udid, name string) error
- func ResetDeviceSets()
- func Shutdown(ctx context.Context, set, udid string) error
- func SlimmableSet() map[string]bool
- func SplitList(s string) []string
- func ValidateDiskCleanupSelection(ids []string) ([]string, error)
- func WaitShutdown(ctx context.Context, set, udid string, timeout time.Duration) error
- type AlwaysEnabledService
- type Category
- type Device
- type DeviceSummary
- type DiskCleanupCategory
- type DiskCleanupCategoryMeasurement
- type DiskCleanupPlan
- type DiskCleanupResult
- type DiskMeasurement
- type DiskStorageMeasurement
- type DoctorOutput
- type DroppedCategory
- type Feature
- type FeatureStatus
- type Measurement
- type Process
- type Profile
- type Reporter
- type SimulatorMutationOutput
- type SlimProfile
- type Status
- type StatusOutput
- type TopOutput
- type TopProcesses
- type TopSim
Constants ¶
const ShutdownTimeout = 30 * time.Second
Variables ¶
var BootTimeout = 10 * time.Minute
BootTimeout bounds a full boot-and-reconfigure (boots twice on a first slim); a var, not a const, so `--boot-timeout` / SIMSLIM_BOOT_TIMEOUT can raise it for CI.
var Categories = []Category{ { ID: "widgets", Name: "Widgets & Wallpaper", Description: "Home and lock screen posters, widgets, and Live Activities.", Downside: "Home and Lock Screen widgets, wallpaper posters, and Live Activities stop updating.", ApproxMemoryMB: 675, Labels: []string{ "com.apple.PosterBoard", "com.apple.chronod", "com.apple.liveactivitiesd", }, }, { ID: "siri", Name: "Siri & Intelligence", Description: "Siri, Apple Intelligence, speech, and on-device ML model services.", Downside: "Siri, speech features, and Apple Intelligence services are unavailable.", ApproxMemoryMB: 265, Labels: []string{ "com.apple.assistantd", "com.apple.assistant_cdmd", "com.apple.assistant_service", "com.apple.siriactionsd", "com.apple.siriinferenced", "com.apple.siriknowledged", "com.apple.sirittsd", "com.apple.siri.context.service", "com.apple.siri.acousticsignature", "com.apple.corespeechd", "com.apple.voiced", "com.apple.voicebankingd", "com.apple.speechmodeltrainingd", "com.apple.intelligenceplatformd", "com.apple.intelligencecontextd", "com.apple.intelligenceflowd", "com.apple.intelligencetasksd", "com.apple.generativeexperiencesd", "com.apple.knowledgeconstructiond", "com.apple.naturallanguaged", "com.apple.textunderstandingd", "com.apple.modelcatalogd", "com.apple.modelmanagerd", "com.apple.mlhostd", "com.apple.mlruntimed", "com.apple.suggestd", "com.apple.parsecd", "com.apple.parsec-fbf", "com.apple.proactiveeventtrackerd", }, }, { ID: "search", Name: "Spotlight & Search", Description: "On-device Spotlight and in-Settings search services.", Downside: "Spotlight and Settings search return no results.", ApproxMemoryMB: 50, Labels: []string{ "com.apple.searchd", "com.apple.searchtoold", "com.apple.spotlightknowledged", "com.apple.spotlightknowledged.updater", "com.apple.corespotlightservice", }, }, { ID: "icloud", Name: "iCloud & Apple Account", Description: "iCloud sync, Apple Account, keychain, and backup services.", Downside: "iCloud sync, Apple Account, Keychain, and backup workflows will not work.", ApproxMemoryMB: 100, Labels: []string{ "com.apple.appleaccountd", "com.apple.appleaccounttransparencyd", "com.apple.appleidsetupd", "com.apple.akd", "com.apple.amsaccountsd", "com.apple.amsengagementd", "com.apple.amsondevicestoraged", "com.apple.cloudd", "com.apple.cloudphotod", "com.apple.ckdiscretionaryd", "com.apple.cloudsettingssyncagent", "com.apple.bird", "com.apple.syncdefaultsd", "com.apple.cdpd", "com.apple.sosd", "com.apple.SecureBackupDaemon", "com.apple.TrustedPeersHelper", "com.apple.protectedcloudstorage.protectedcloudkeysyncing", "com.apple.icloudmailagent", "com.apple.icloudsubscriptionoptimizerd", "com.apple.communicationtrustd", }, }, { ID: "store", Name: "App Store, Push & Media", Description: "App Store, push notification, StoreKit, and media services.", Downside: "Remote push notifications and StoreKit or App Store testing will not work.", ApproxMemoryMB: 80, Labels: []string{ "com.apple.appstored", "com.apple.appstorecomponentsd", "com.apple.apsd", "com.apple.itunescloudd", "com.apple.itunesstored", "com.apple.storekitd", "com.apple.videosubscriptionsd", "com.apple.assetsubscriptiond", "com.apple.musicd", }, }, { ID: "pim", Name: "Mail, Calendar & Contacts", Description: "Mail, Calendar, Contacts, Reminders, and related sync services.", Downside: "Contacts, Calendar, Reminders, and Mail-backed pickers or sync may fail.", ApproxMemoryMB: 80, Labels: []string{ "com.apple.email.maild", "com.apple.exchangesyncd", "com.apple.dataaccess.dataaccessd", "com.apple.calaccessd", "com.apple.remindd", "com.apple.contactsd", "com.apple.contacts.postersyncd", "com.apple.peopled", }, }, { ID: "web", Name: "Safari Sync & Web Services", Description: "Safari sync, web push, privacy, and universal-link services.", Downside: "Universal links and Safari sync or background web services will not work.", ApproxMemoryMB: 50, Labels: []string{ "com.apple.SafariBookmarksSyncAgent", "com.apple.Safari.History", "com.apple.Safari.passwordbreachd", "com.apple.Safari.SafeBrowsing.Service", "com.apple.safarifetcherd", "com.apple.WebBookmarks.webbookmarksd", "com.apple.webkit.adattributiond", "com.apple.webkit.webpushd", "com.apple.webprivacyd", "com.apple.swcd", }, }, { ID: "family", Name: "Family & Screen Time", Description: "Family Sharing, Screen Time, and usage tracking.", Downside: "Family Sharing, Screen Time, and usage tracking stop working.", ApproxMemoryMB: 65, Labels: []string{ "com.apple.familycircled", "com.apple.FamilyControlsAgent", "com.apple.familynotification", "com.apple.askpermissiond", "com.apple.asktod", "com.apple.ScreenTimeAgent", "com.apple.ScreenTimeSettingsAgent", "com.apple.UsageTrackingAgent", }, }, { ID: "health", Name: "Health, Home & Fitness", Description: "HealthKit, HomeKit, and Fitness services.", Downside: "HealthKit, HomeKit, and Fitness integrations will not work.", ApproxMemoryMB: 135, Labels: []string{ "com.apple.healthd", "com.apple.healthappd", "com.apple.healthcontentd", "com.apple.healtheventsd", "com.apple.healthrecordsd", "com.apple.finhealthd", "com.apple.homed", "com.apple.homeeventsd", "com.apple.fitcore", "com.apple.fitcore.session", "com.apple.fitnesscoachingd", "com.apple.fitnessintelligenced", "com.apple.activityawardsd", "com.apple.activitysharingd", }, }, { ID: "photos", Name: "Photos & Media Analysis", Description: "Photos library, photo analysis, and media analysis services.", Downside: "Photo picker, Photos-library workflows, and media analysis may fail.", ApproxMemoryMB: 60, Labels: []string{ "com.apple.photoanalysisd", "com.apple.photosface", "com.apple.mediaanalysisd", "com.apple.mediaanalysisd.service", "com.apple.mediastream.mstreamd", "com.apple.medialibraryd", "com.apple.assetsd", "com.apple.assetsd.nebulad", }, }, { ID: "apps", Name: "News, Weather, Maps & Games", Description: "News, Weather, Maps, Tips, and game services.", Downside: "News, Weather, Maps background data, and game-controller services are unavailable.", ApproxMemoryMB: 90, Labels: []string{ "com.apple.newsd", "com.apple.weatherd", "com.apple.Maps.mapssyncd", "com.apple.Maps.mapspushd", "com.apple.Maps.geocorrectiond", "com.apple.maps.destinationd", "com.apple.MapKit.SnapshotService", "com.apple.jetpackassetd", "com.apple.tipsd", "com.apple.gamed", "com.apple.gamesaved", "com.apple.GameController.gamecontrollerd", }, }, { ID: "messaging", Name: "Messaging & FaceTime", Description: "iMessage, FaceTime, call, and identity services.", Downside: "iMessage, FaceTime, and related identity services will not work.", ApproxMemoryMB: 60, Labels: []string{ "com.apple.identityservicesd", "com.apple.ids_simd", "com.apple.imautomatichistorydeletionagent", "com.apple.imcore.imtransferagent", "com.apple.imdpersistence.IMDPersistenceAgent", "com.apple.facetimemessagestored", "com.apple.telephonyutilities.callservicesd", }, }, { ID: "connectivity", Name: "Sharing & Device Connectivity", Description: "AirDrop, Continuity, CarPlay, Watch, and Find My services.", Downside: "AirDrop, Continuity, CarPlay, Watch, and Find My connectivity will not work.", ApproxMemoryMB: 65, Labels: []string{ "com.apple.rapportd", "com.apple.companiond", "com.apple.carkitd", "com.apple.wcd", "com.apple.tvremoted", "com.apple.avatarsd", "com.apple.stickersd", "com.apple.sociallayerd", "com.apple.announced", "com.apple.navd", "com.apple.findmy.findmylocated", }, AlwaysEnabled: []AlwaysEnabledService{ { Label: "com.apple.sharingd", Reason: "Required for system share sheets.", }, }, }, { ID: "telemetry", Name: "Ads, Diagnostics & Telemetry", Description: "DeviceCheck, ad privacy, analytics, diagnostics, and feedback services.", Downside: "DeviceCheck plus analytics, diagnostics, and feedback services are unavailable.", ApproxMemoryMB: 105, Labels: []string{ "com.apple.ap.adprivacyd", "com.apple.ap.promotedcontentd", "com.apple.diagnosticextensionsd", "com.apple.feedbackd", "com.apple.rtcreportingd", "com.apple.securityuploadd", "com.apple.geoanalyticsd", "com.apple.triald", "com.apple.followupd", "com.apple.purplebuddy.budd", "com.apple.devicecheckd", }, }, { ID: "other", Name: "Other Background Services", Description: "Wallet, business services, assets, and miscellaneous background daemons.", Downside: "Wallet, merchant, business, asset, and miscellaneous background services are unavailable.", ApproxMemoryMB: 195, Labels: []string{ "com.apple.financed", "com.apple.passd", "com.apple.merchantd", "com.apple.coreidvd", "com.apple.businessservicesd", "com.apple.deviceaccessd", "com.apple.replicatord", "com.apple.linkd", "com.apple.ind", "com.apple.storagedatad", "com.apple.StatusKitAgent", "com.apple.countryd", "com.apple.mobileassetd", "com.apple.managedconfiguration.passcodenagd", }, }, }
Categories is the complete allowlist of daemons a profile may disable. ApproxMemoryMB values are rounded median increases in phys_footprint when only that category is kept on versus a fully slim iOS 26.5 clean boot. The estimates vary by runtime and workload and are not additive.
var DiskCleanupCategories = []DiskCleanupCategory{ { ID: "caches", Name: "System & App Caches", Description: "Generated cache files belonging to iOS and installed apps.", Downside: "Next launches may be slower; downloaded or offline cache content can disappear.", Recovery: "Old cache contents stay deleted; apps build new caches as needed.", Risk: "Lower risk", DefaultSelected: true, CanClean: true, }, { ID: "logs", Name: "Logs & Diagnostics", Description: "Unified logs, signposts, symbol text, crash logs, and app log folders.", Downside: "Existing diagnostic and crash history is deleted.", Recovery: "Old history stays deleted; future runs create new logs.", Risk: "Lower risk", DefaultSelected: true, CanClean: true, }, { ID: "temporary", Name: "Temporary Files", Description: "Files in simulator and app temporary directories.", Downside: "Apps that misuse temporary storage may lose in-progress work.", Recovery: "Old contents stay deleted; apps create new temporary files as needed.", Risk: "Lower risk", DefaultSelected: true, CanClean: true, }, { ID: "linguistic-data", Name: "Downloaded Language Data", Description: "On-demand language models used by Siri, Search, and text analysis.", Downside: "Language-aware features may be limited until iOS downloads the package again.", Recovery: "iOS downloads the language package again when a feature needs it.", Risk: "Restored on demand", DefaultSelected: false, CanClean: true, }, { ID: "required-siri-assets", Name: "Required Siri Assets", Description: "Siri understanding, speech, voice, and accessibility downloads restored by iOS.", Downside: "Manual deletion is unsupported, and iOS promptly downloads required assets again.", Recovery: "Required assets return automatically after boot.", Risk: "System managed", DefaultSelected: false, CanClean: false, }, }
var Features = []Feature{ {ID: "push", Name: "Push notifications", Labels: []string{"com.apple.apsd"}}, {ID: "storekit", Name: "StoreKit / in-app purchase", Labels: []string{"com.apple.storekitd"}}, {ID: "app-store", Name: "App Store", Labels: []string{"com.apple.appstored", "com.apple.itunesstored"}}, {ID: "universal-links", Name: "Universal links / associated domains", Labels: []string{"com.apple.swcd"}}, {ID: "spotlight", Name: "Spotlight & Settings search", Labels: []string{"com.apple.searchd", "com.apple.searchtoold"}}, {ID: "siri", Name: "Siri & speech", Labels: []string{"com.apple.assistantd", "com.apple.corespeechd"}}, {ID: "icloud", Name: "iCloud sync", Labels: []string{"com.apple.cloudd"}}, {ID: "keychain-sync", Name: "iCloud Keychain", Labels: []string{"com.apple.akd"}}, {ID: "contacts", Name: "Contacts", Labels: []string{"com.apple.contactsd"}}, {ID: "calendar", Name: "Calendar", Labels: []string{"com.apple.calaccessd"}}, {ID: "reminders", Name: "Reminders", Labels: []string{"com.apple.remindd"}}, {ID: "mail", Name: "Mail", Labels: []string{"com.apple.email.maild"}}, {ID: "photos", Name: "Photos library & analysis", Labels: []string{"com.apple.assetsd", "com.apple.photoanalysisd"}}, {ID: "health", Name: "HealthKit", Labels: []string{"com.apple.healthd"}}, {ID: "homekit", Name: "HomeKit", Labels: []string{"com.apple.homed"}}, {ID: "imessage", Name: "iMessage & FaceTime", Labels: []string{"com.apple.identityservicesd"}}, {ID: "widgets", Name: "Widgets & Live Activities", Labels: []string{"com.apple.chronod", "com.apple.liveactivitiesd"}}, {ID: "wallet", Name: "Wallet & passes", Labels: []string{"com.apple.passd"}}, {ID: "maps", Name: "Maps background services", Labels: []string{"com.apple.Maps.mapssyncd"}}, {ID: "weather", Name: "Weather", Labels: []string{"com.apple.weatherd"}}, {ID: "news", Name: "News", Labels: []string{"com.apple.newsd"}}, {ID: "game-center", Name: "Game Center", Labels: []string{"com.apple.gamed"}}, {ID: "find-my", Name: "Find My", Labels: []string{"com.apple.findmy.findmylocated"}}, {ID: "screen-time", Name: "Screen Time", Labels: []string{"com.apple.ScreenTimeAgent"}}, }
Features maps commonly required capabilities to the daemons they need running.
Functions ¶
func BootAndWait ¶
bootAndWait boots the device (tolerating an already-booted one) and blocks on bootstatus until its services are ready.
func CloneDevice ¶
cloneDevice temporarily shuts down a booted source because CoreSimulator can only clone a stable device, then restores the source's original boot state.
func DisableSlim ¶
disableSlim re-enables every managed daemon, returning the device to stock.
func EnableSlim ¶
enableSlim disables the profile's daemons and boots the device slim.
func ExtraDeviceSetTokens ¶
func ExtraDeviceSetTokens() []string
ExtraDeviceSetTokens returns the tokens registered with RegisterDeviceSet, beyond the well-known default and testing sets.
func MarshalProfile ¶
func MarshalProfile(sp SlimProfile) ([]byte, error)
marshalProfile renders a profile as indented JSON with a trailing newline.
func MeasureMany ¶
measureMany takes one process and footprint snapshot for every requested simulator. This keeps the GUI's RAM column current without running the relatively expensive `top` command once per booted device.
func NormalizeSimulatorName ¶
func ProfileFileName ¶
profileFileName derives a JSON filename from a profile name, for when the command targets a directory. Non-filename runs collapse to a hyphen; an empty name falls back to profile.json.
func RegisterDeviceSet ¶
func RegisterDeviceSet(value string)
registerDeviceSet adds a --set value to the scanned sets ignoring any that duplicate an already-known token.
func ResetDeviceSets ¶
func ResetDeviceSets()
ResetDeviceSets drops every set registered with RegisterDeviceSet.
func SlimmableSet ¶
slimmableSet is every label a service profile may disable.
func SplitList ¶
SplitList parses the comma-separated list syntax shared by the --except, --keep, --requires and --categories flags, dropping blank entries.
Types ¶
type AlwaysEnabledService ¶
AlwaysEnabledService is shown alongside a category for transparency but is never included in a slim profile. Earlier versions may have disabled it, so it remains in the mutation allowlist solely to repair that legacy state.
type Category ¶
type Category struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Downside string `json:"downside"`
ApproxMemoryMB int `json:"approxMemoryMB"`
Labels []string `json:"labels"`
ServiceDescriptions map[string]string `json:"serviceDescriptions"`
AlwaysEnabled []AlwaysEnabledService `json:"alwaysEnabled,omitempty"`
}
Category groups launchd daemon labels that a slim boot disables together.
func CategoryByID ¶
type Device ¶
type Device struct {
UDID string `json:"udid"`
Name string `json:"name"`
State string `json:"state"` // "Booted" or "Shutdown"
OSVersion string `json:"osVersion"`
Set string `json:"set"`
DataPath string `json:"-"`
}
Device is a simulator as reported by `simctl list`.
func FindDevice ¶
findDevice locates a simulator by UDID. An empty set searches every known set. A non-empty set looks only there, so repeated lookups need not rescan.
type DeviceSummary ¶
type DeviceSummary struct {
Device
ManagedDisabled *int `json:"managedDisabled,omitempty"`
ManagedTotal int `json:"managedTotal"`
StatusError string `json:"statusError,omitempty"`
Memory *Measurement `json:"memory,omitempty"`
MemoryError string `json:"memoryError,omitempty"`
}
DeviceSummary is the stable, machine-readable representation used by the macOS app and other integrations. managedDisabled is omitted for shutdown simulators because launchd state can only be read while a simulator is booted.
type DiskCleanupCategory ¶
type DiskCleanupCategory struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Downside string `json:"downside"`
Recovery string `json:"recovery"`
Risk string `json:"risk"`
DefaultSelected bool `json:"defaultSelected"`
CanClean bool `json:"canClean"`
}
DiskCleanupCategory describes one tightly allowlisted class of per-device data. Runtime files are deliberately outside this model: an iOS runtime is shared by many simulators and must only be managed by Xcode/simctl.
type DiskCleanupCategoryMeasurement ¶
type DiskCleanupCategoryMeasurement struct {
DiskCleanupCategory
Bytes int64 `json:"bytes"`
Targets int `json:"targets"`
}
type DiskCleanupPlan ¶
type DiskCleanupPlan struct {
UDID string `json:"udid"`
TotalBytes int64 `json:"totalBytes"`
CleanableBytes int64 `json:"cleanableBytes"`
Categories []DiskCleanupCategoryMeasurement `json:"categories"`
Storage []DiskStorageMeasurement `json:"storage"`
}
func PlanDiskCleanup ¶
func PlanDiskCleanup(ctx context.Context, udid string) (DiskCleanupPlan, error)
type DiskCleanupResult ¶
type DiskCleanupResult struct {
UDID string `json:"udid"`
CategoryIDs []string `json:"categoryIds"`
BeforeBytes int64 `json:"beforeBytes"`
AfterBytes int64 `json:"afterBytes"`
ReclaimedBytes int64 `json:"reclaimedBytes"`
WasBooted bool `json:"wasBooted"`
BootStateRestored bool `json:"bootStateRestored"`
}
func CleanDeviceDisk ¶
type DiskMeasurement ¶
type DiskMeasurement struct {
Bytes int64 `json:"bytes"`
}
func DeviceDiskUsage ¶
func DeviceDiskUsage(ctx context.Context, udid string) (DiskMeasurement, error)
deviceDiskUsage reports allocated filesystem blocks for one exact simulator device directory. It deliberately resolves the UDID through simctl first so aliases such as "all" can never become filesystem paths.
type DiskStorageMeasurement ¶
type DiskStorageMeasurement struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Bytes int64 `json:"bytes"`
}
DiskStorageMeasurement is a read-only breakdown of durable per-simulator storage. These rows are deliberately separate from cleanup categories so documents, app bundles, and user data can never become selected for deletion.
type DoctorOutput ¶
type DoctorOutput struct {
UDID string `json:"udid,omitempty"`
OK bool `json:"ok"`
Features []FeatureStatus `json:"features"`
}
DoctorOutput reports whether each required feature survives the device's current slimming. OK is false when any required feature has a disabled daemon.
func DiagnoseFeatures ¶
func DiagnoseFeatures(features []Feature, disabled map[string]bool) DoctorOutput
diagnoseFeatures reports, for each feature, which of its daemons the device currently has disabled. A feature is OK only when none of them are.
type DroppedCategory ¶
type DroppedCategory struct {
ID string `json:"id"`
Name string `json:"name"`
Downside string `json:"downside"`
Labels []string `json:"labels"`
}
DroppedCategory lists the managed daemons a category has disabled on a simulator, alongside the feature that stops working as a result.
func DroppedCategories ¶
func DroppedCategories(disabled map[string]bool) []DroppedCategory
droppedCategories groups the disabled managed daemons by category, in category order, omitting categories with nothing disabled.
type Feature ¶
type Feature struct {
ID string `json:"id"`
Name string `json:"name"`
Labels []string `json:"labels"`
}
Feature is a user-facing capability backed by specific launchd daemons. Every label must also live in a Category (enforced in features_test.go), so a feature only ever names daemons the tool could actually have turned off.
func ResolveFeatures ¶
resolveFeatures maps requested IDs to their Features, erroring on the first unknown one so a typo in --requires fails loudly instead of passing silently.
type FeatureStatus ¶
type FeatureStatus struct {
ID string `json:"id"`
Name string `json:"name"`
OK bool `json:"ok"`
Disabled []string `json:"disabled,omitempty"`
}
FeatureStatus is one feature's verdict: the daemons it needs that are down.
type Measurement ¶
type Measurement struct {
Processes int `json:"processes"`
Bytes int64 `json:"bytes"` // summed phys_footprint (compressed + dirty), the number that caps how many sims fit
CPU float64 `json:"cpu"` // summed %cpu across the tree (ps's decaying average; can exceed 100 on multicore)
}
Measurement is a device's real memory cost.
func Measure ¶
func Measure(ctx context.Context, udid string) (Measurement, error)
measure sums the phys_footprint of every process in the device's launchd tree. phys_footprint (the same value Activity Monitor's "Memory" column reports) counts compressed and swapped pages, so it stays accurate under memory pressure where resident size would read misleadingly low.
type Process ¶ added in v0.5.0
type Process struct {
PID int `json:"pid"`
Command string `json:"command"`
Bytes int64 `json:"bytes"`
CPU float64 `json:"cpu"`
}
Process is one process in a simulator's launchd tree, for the top drill-down.
type Profile ¶
type Profile struct {
ExceptCategories map[string]bool // category IDs to leave fully enabled
Keep map[string]bool // individual labels to leave enabled
}
Profile selects which managed daemons a slim boot should disable.
func BuildProfile ¶
buildProfile selects the slim profile for an `on` invocation. A --profile file is the single source of truth, so it cannot be combined with --except/--keep.
func LoadSlimProfile ¶
loadSlimProfile reads a profile file and resolves it to a validated Profile.
type Reporter ¶
type Reporter func(string)
Reporter receives human-readable progress lines. A nil Reporter is a no-op, so non-interactive callers can ignore progress entirely.
type SimulatorMutationOutput ¶
type SimulatorMutationOutput struct {
Action string `json:"action"`
UDID string `json:"udid"`
Name string `json:"name,omitempty"`
SourceUDID string `json:"sourceUdid,omitempty"`
}
SimulatorMutationOutput is returned by simulator-management commands so the GUI can refresh and, for clone, select the newly created device.
type SlimProfile ¶
type SlimProfile struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Except []string `json:"except,omitempty"`
Keep []string `json:"keep,omitempty"`
}
SlimProfile is the on-disk profile applied with `simslim on --profile <path>`. Except and Keep mirror the `--except` and `--keep` flags.
type Status ¶
type Status struct {
ManagedDisabled int `json:"managedDisabled"` // managed labels currently disabled
ManagedTotal int `json:"managedTotal"` // size of the managed universe
Booted bool `json:"booted"`
}
Status describes how slim a device currently is.
func ReadStatus ¶
status reports how slim a device is and returns the labels it currently has disabled (nil when the device is not booted).
type StatusOutput ¶
type StatusOutput struct {
Status
Verdict string `json:"verdict"`
Dropped []DroppedCategory `json:"dropped,omitempty"` // only when `status --dropped` is requested
}
type TopOutput ¶ added in v0.5.0
TopOutput is the fleet view: every booted simulator plus the summed footprint that decides how many more fit.
func FleetSnapshot ¶ added in v0.5.0
FleetSnapshot gathers the live resource view of every booted simulator: its slim status and memory come from one shared process snapshot; disk usage is optional because it shells out to `du` per device and is comparatively slow.
type TopProcesses ¶ added in v0.5.0
type TopProcesses struct {
UDID string `json:"udid"`
Name string `json:"name,omitempty"`
Processes []Process `json:"processes"`
TotalBytes int64 `json:"totalBytes"`
}
TopProcesses is one simulator's per-daemon breakdown, the top drill-down.
type TopSim ¶ added in v0.5.0
type TopSim struct {
Device
ManagedDisabled *int `json:"managedDisabled,omitempty"`
ManagedTotal int `json:"managedTotal"`
StatusError string `json:"statusError,omitempty"`
Memory *Measurement `json:"memory,omitempty"`
MemoryError string `json:"memoryError,omitempty"`
DiskBytes *int64 `json:"diskBytes,omitempty"`
}
TopSim is one booted simulator's live resource snapshot for `simslim top`.
