biometricEnrolled method
The enrolment the Simulator's Features > Face ID menu toggles; null when unreadable.
Implementation
Future<bool?> biometricEnrolled(String udid) async {
try {
final res = await runBounded('xcrun', ['simctl', 'spawn', udid, 'notifyutil', '-g', _enrollmentKey],
timeout: const Duration(seconds: 8), phase: 'reading Face ID enrollment');
if (res.exitCode != 0) return null;
return switch ((res.stdout as String).trim().split(' ').last) {
'1' => true,
'0' => false,
_ => null,
};
} on Object {
return null;
}
}