SimControl class

Status + lightweight control of an iOS simulator over xcrun simctl. Heavier control (location, push, status-bar) is roadmapped.

Constructors

SimControl()
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

appPid(String udid, String bundleId) → Future<int?>
The process id of bundleId on udid, null when it is not running or launchctl cannot be asked.
biometricAttempt(String udid, {required bool match, required bool touch}) → Future<String?>
Answers a pending biometric prompt with a matching or non-matching face (touch false) or finger.
biometricEnrolled(String udid) → Future<bool?>
The enrolment the Simulator's Features > Face ID menu toggles; null when unreadable.
isAppRunning(String udid, String bundleId) → Future<bool?>
Whether bundleId has a live process on udid; null when launchctl cannot be asked within probeLimit.
isBooted(String udid) → Future<bool>
Full status for udid, or null if no such device exists. True when udid is currently booted; false when shut down or unknown.
isLocked(String udid) → Future<bool?>
SpringBoard's lock state: true locked, false unlocked, null when unreadable.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openUrl(String udid, String url) → Future<String?>
Open a URL / deeplink on the simulator.
privacy(String udid, String action, String service, {String? bundleId}) → Future<String?>
Grant / revoke / reset a privacy permission. action grant|revoke|reset; service e.g. photos; bundleId required for grant/revoke.
runningApps(String udid) → Future<List<String>>
Bundle ids of the apps running on udid right now (backgrounded ones too), empty when the list cannot be read.
screenshot(String udid, String path) → Future<ScreenshotResult>
Capture a PNG to path (works headless); returns saved path + pixel size (also the tap-ratio reference: ratio = pixel / size) or an error.
setAppearance(String udid, String mode) → Future<String?>
Set the simulator appearance. mode is light or dark.
setBiometricEnrolled(String udid, bool enrolled) → Future<String?>
Enrols or unenrols Face ID / Touch ID (one flag covers both), then posts the change so running apps see it.
state(String udid) → Future<String?>
The simulator's boot state (Booted, Shutdown, ...), null when it is unknown or unreadable.
status(String udid) → Future<SimStatus?>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

probeLimit → const Duration