Test Biometric Authentication on mobile devices with XCUITest framework
Simulate Touch ID, fingerprint, and Face ID authentication on supported real devices during your test sessions.
The majority of mobile devices today support biometric hardware sensors to authenticate device owner’s identity. BrowserStack enables you to test biometric authentication such as touch ID or fingerprint sensor and face ID on a BrowserStack mobile device with XCUITest framework.
This feature is available only under Device Cloud Pro, Device Cloud Pro + Visual Cloud, and Enterprise Pro plans. For more details, check out our pricing page.
Supported devices and apps
| OS | Version |
|---|---|
| iOS | 13 and higher |
- Native apps and apps built with cross platform frameworks such as React Native, Flutter, etc. are supported.
- However, apps using code obfuscation tools such as Proguard are not supported.
- Apps signed with Enterprise certificates are not supported. Biometric feature needs
resignAppparameter to betrue.
Enable biometric authentication
Use BrowserStack parameter enableBiometric and set it to true in the REST API request to enable Biometric Authentication functionality for your XCUITest test session.
This ensures your app undergoes Sensor Instrumentation, which is a process using which BrowserStack supports the app’s interaction with biometric mobile sensors on BrowserStack real devices.
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{
"enableBiometric": "true",
"app": "bs://j3c874f21852ba57957a3fdc33f47514288c4ba4",
"testSuite": "<test_suite_url>",
"devices": ["iPhone 11-13"]}' \
-H "Content-Type: application/json"
Test biometric authentication after enabling it
When you trigger the Biometric Authentication test workflow in your app, the below BrowserStack prompt shows up. You can click Pass or Fail to succeed or fail the authentication respectively.

Frequently asked questions
How does biometric authentication work on BrowserStack mobile devices?
BrowserStack supports an app’s interaction with different mobile sensors such as Biometric using Sensor Instrumentation. Sensor Instrumentation is the process in which, if Biometric is enabled for the session, we inject BrowserStack’s Biometric code module into the app, which mocks or overrides Biometric APIs used by the app.
What biometric APIs are supported by the BrowserStack biometric feature?
The biometric feature works only if the app uses any of the following supported Biometric APIs. To get more details about the Biometric APIs your app uses, check with your app development team.
We currently support the following Biometric APIs in iOS SDK:
-
canEvaluatePolicyandevaluatePolicyAPIs from theLAContextclass in the Apple’s iOS Biometric SDK. For more details, check the LAContext Apple documentation.
We currently don’t support apps using iOS Keychain APIs with Biometric access control. For more details, check Apple documentation on Keychain access with Biometric authentication.
Do we need to register a biometric on the mobile device or make any changes to the app code?
No. You do not need to register any biometric on the mobile device or make any changes in the app code.
Need help?
If you have any queries, get in touch with us.
Related topics
-
Manage your uploaded app or test suite using our upload app REST API and upload test suite REST API.
-
Use the get app API endpoint and list test suites API endpoint to list your recently uploaded apps and test suites.
-
Delete your uploaded app or test suite using the delete app API endpoint and delete test suite API endpoint.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!