How to Test Face ID and Touch ID on iPhone
Test Face ID and Touch ID in your iOS app: LAContext setup, simulated enrollment and match tests, fallback and lockout cases, and real-iPhone checks.
Short answer: biometric authentication on iPhone means confirming who someone is with Face ID or Touch ID instead of typing a passcode. Apps use it through Apple's LocalAuthentication framework. To test it, use a simulated device to test your app's logic. Its biometric controls let you set enrollment and send a matching or non-matching face or fingerprint. In the Simulator app in Xcode 26.6, these are under Features > Face ID (or Features > Touch ID on a Touch ID device): Enrolled, Matching Face / Non-matching Face (Matching Touch / Non-matching Touch for Touch ID). Then use a real iPhone to check what only hardware shows: the system Face ID prompt, your NSFaceIDUsageDescription text, lockout after repeated failures, and the passcode fallback.
| # | Case | How to trigger | Expected |
|---|---|---|---|
| 1 | Success | Matching face or finger | Signed in; the protected screen shows |
| 2 | Failure | Non-matching face or finger | Retry or fallback offered; no access |
| 3 | Lockout | Repeated failures until biometry locks | LAError.biometryLockout; passcode or password path works |
| 4 | Not enrolled | Remove enrollment | LAError.biometryNotEnrolled; the app offers another sign-in method |
| 5 | Permission denied | Turn off Face ID for your app in Settings | The app explains and falls back. It doesn't loop the prompt. |
| 6 | Biometry changed | Add or remove a face or fingerprint | evaluatedPolicyDomainState differs; the app re-verifies the person |
How do Face ID and Touch ID work in an iOS app?
Apps use the LocalAuthentication framework. Create an LAContext, call canEvaluatePolicy(_:error:), then call evaluatePolicy(_:localizedReason:reply:) (Apple: LAContext; Apple: Logging a user into your app with Face ID or Touch ID).
let context = LAContext()
var error: NSError?
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics,
localizedReason: "Sign in to your account") { success, error in
// handle success, or map error to LAError.Code
}
} else {
// biometry unavailable or not enrolled: show another sign-in method
}
These rules from Apple's docs turn directly into test cases:
biometryTypehas a value only after you callcanEvaluatePolicy. Check that your UI never says "Touch ID" on a Face ID device, and the reverse (Apple).NSFaceIDUsageDescriptionis required if your app uses Face ID APIs (Apple). Test that the string is present and reads well in every language you ship.- Policy choice changes fallback. With
.deviceOwnerAuthenticationWithBiometrics, tapping the fallback button returnsuserFallback, and your app has to provide its own PIN or password path. With.deviceOwnerAuthentication, the system handles fallback with the device passcode (Apple). - Lockout is system-wide. After too many failed attempts, Face ID and Touch ID turn off until the person enters the device passcode, even if the attempts were spread across several calls.
How do I test Face ID in the iOS Simulator?
- Run your app on a simulated iPhone that supports Face ID.
- Turn on Face ID enrollment for the simulated device.
- Trigger your sign-in, then send a matching face to test success or a non-matching face to test failure.
- Turn enrollment off and confirm your app handles
biometryNotEnrolled.
Apple's Simulator Help describes these controls: you set the device as enrolled, then send matching or non-matching input (Apple Simulator Help, archived). In the Simulator app in Xcode 26.6, choose Features > Face ID > Enrolled, then Features > Face ID > Matching Face or Non-matching Face. On a Touch ID device, use Features > Touch ID > Enrolled, then Matching Touch or Non-matching Touch.
Use XCTest UI tests (Apple: XCTest) to assert what each case shows on screen.
How do I test a Face ID or Touch ID failure or lockout?
- Failure: send a non-matching face. Confirm the app doesn't grant access, and that a retry or fallback button appears.
- Cancel: tap Cancel on the prompt. You should get
userCancel, with no error loop and no forced sign-out. - Lockout: on a test device, fail repeatedly until biometry locks. You should get
biometryLockout, and your fallback must still let the person in. Unlocking again needs the device passcode. - Biometry changed: store
evaluatedPolicyDomainStateafter a successful check. Add or remove a face or fingerprint, then compare. Apple notes the value tells you that the enrolled biometrics changed, not what changed (Apple). Decide whether your app should ask for the password again, and test that it does.
The full list of error codes is in LAError.Code.
Why is my Face ID prompt not showing?
Check in this order:
NSFaceIDUsageDescriptionis missing fromInfo.plist.canEvaluatePolicyreturned false, because biometry isn't enrolled or isn't available, and your code skipped the prompt without showing anything.- The person turned off Face ID for your app in Settings.
- Biometry is locked out after failed attempts.
- You're reusing an
LAContextthat was invalidated.
Why do you still need a real iPhone?
A simulated device checks your logic, but it can't show you how real Face ID hardware behaves: the system prompt's timing and appearance, lighting and angle, glasses or masks, and how the passcode fallback feels on screen. Apple also notes that Face ID starts scanning as soon as the prompt appears, unlike Touch ID, so check that your UI warns people before that moment. Before release, run the six cases above on at least one Face ID iPhone and, if you support them, one Touch ID device.
Android: the equivalent is BiometricPrompt with BIOMETRIC_STRONG or DEVICE_CREDENTIAL and a canAuthenticate() check (Android: Show a biometric authentication dialog).
Can Mobot test Face ID on a real iPhone?
Yes. Mobot testing robots run Face ID cases on real iPhones using a 3D face model, so match and non-match cases go through the real TrueDepth camera. Touch ID cases need a person: a Mobot team member steps in to provide a genuine fingerprint. Mobot testing robots also tap through the passcode fallback and enter the device passcode, so the fallback path is tested too. They can also present a non-matching face until Face ID locks, then enter the passcode to check lockout. Mobot AI and Mobot's team build your test cases from your sign-in flow. Defect reports include device screenshots of each step.
FAQ
What is biometric authentication on iPhone? It's signing in or confirming an action with Face ID or Touch ID instead of a passcode. Apps request it through the LocalAuthentication framework, and the device passcode can act as the fallback.
How do I test Face ID in the iOS Simulator? Turn on Face ID enrollment for the simulated device, trigger your sign-in, then send a matching face for success or a non-matching face for failure. Turn enrollment off to test the not-enrolled path.
How do I test a Face ID failure or lockout?
Send non-matching faces until biometry locks. Confirm your app receives LAError.biometryLockout and that a password or passcode fallback still lets the person in.
Why is my Face ID prompt not showing?
The most common causes are a missing NSFaceIDUsageDescription, biometry not enrolled, Face ID turned off for the app in Settings, or lockout.
Can Mobot test Face ID on a real iPhone? Yes. Mobot testing robots run Face ID cases on real iPhones using a 3D face model, so match and non-match cases go through the real TrueDepth camera. Touch ID cases need a Mobot team member to provide a genuine fingerprint. Mobot testing robots also tap through the passcode fallback and enter the device passcode, so the fallback path is tested too. They can also present a non-matching face until Face ID locks, then enter the passcode to check lockout. Defect reports include device screenshots.