Seamless Security: Setting Up Biometric Authentication on Android Emulator & iOS Simulator
Tags: mobile, ios, android, security
Published: 2024-03-22 20:49:56

Biometric authentication is a sophisticated method of verifying a user's identity based on unique physical characteristics. These characteristics are nearly impossible to replicate, making biometric authentication one of the most secure methods available. In the context of mobile app development, biometric authentication offers a secure, seamless and secure way for users to access sensitive information.

**Types of Biometric Authentication**
Biometric authentication offers a variety of methods for verifying users' identities, each with its unique strengths and considerations. Here, we'll explore two prominent types of biometric authentication: Face ID for iOS and Fingerprint recognition for Android.

- **Face ID**:  
Face ID is Apple's facial recognition technology available on iOS devices equipped with the TrueDepth camera system. It uses a combination of infrared and visible light to create a detailed depth map of the user's face. This data is securely stored and used to authenticate the user when they attempt to unlock their device or authenticate within apps.

<!-- Insert two blank lines here -->

- **Fingerprint Recognition**:  
Fingerprint recognition, also known as fingerprint biometrics, is a widely used authentication method on Android devices. It captures and analyses the unique patterns of a user's fingerprint. This data is securely stored within the device's hardware or software and used to authenticate the user when they place their finger on the fingerprint sensor.

**Setting Up Android Emulator and Simulator**
Before diving into the implementation of biometric authentication in your Mobile apps, you need to set up the Android Emulator and Simulator on your development environment. Follow these steps to get started:


- **Enabling Face ID on iOS Simulator (Xcode):**
Since the iOS Simulator doesn't support actual Face ID recognition due to hardware limitations, you'll need to simulate it. So to simulate Face ID:

1. Open Simulator
2. Go to Features -> Face ID -> Enrolled


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vtaq8r04b6tka901o3i.png)

Once you tap on "**Enrolled**" you would be able to simulate Face ID authentication on that simulator

NB: If you are using an older XCode version you may have to enable Face ID by going through **_Hardware -> Face ID -> Enrolled_** instead

<!-- Insert two blank lines here -->

- **Enabling Fingerprint Recognition on Android Emulator (Android Studio):**
Android Emulator supports fingerprint recognition simulation for devices with fingerprint sensors. To check if the Emulator has fingerprint sensors:

1. Open Emulator
2. Tap on the 3 dot to open the extended controls
If you can see the "Fingerprint" section, then fingerprint sensor is supported

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6107csrijv64j09rv80k.png)

To enable fingerprint on the emulator:
1. Open Settings and search for "Fingerprint" or "Pixel Imprint." Choose Pixel Imprint.
2. Select Pixel Imprint again to set up your virtual fingerprint.
3. Pick your preferred screen lock: Pattern, PIN, or Password.
4. Agree to the setup by pressing "More" and then "I agree."
5. Follow the prompt to touch the sensor on your device.
6. In Fingerprint settings, choose an option or stick with the default "Finger 1" and press the Touch Sensor button.

Once done, press DONE to finish and start using the sensor in any app on your virtual device.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hd0edxdzqhrsu47pc3f.gif)


And with that you have successfully setup biometrics authentication on your emulator and simulator

To learn how to implement this authentication on your mobile app, stay tuned... there's a second part