While we don’t have time to go into the intricate details of how developers can implement Touch ID and Face ID in their apps, it’s still useful to go over some basics how the of the API works, since these will be relevant later. To anyone on the Embedded Simulator team is reading this, it would be nice if you could release a new build of Xcode with correct capabilities, so I don’t have to muck around with this stuff :) Biometrics on iOS This happened to cause some automated tests in break to fail, and the steps I took to work around this problem were quite similar to the ones described below. At the time of this article being written, the latest version of Xcode, Version 10.1 (10B61), had a rather interesting bug where certain devices reported incorrect results when queried if they supported biometric authentication. You might think that the device we are creating is pointless, since it’s not really useful for testing apps: it doesn’t model any real device, and the iPhone 8 and iPhone XS simulators are available for testing any features specific to either device. Outside of the simulator, this makes no sense due to iPhone lacking the requisite sensors, but since we are running on virtual hardware this is not an issue. To be specific, we will be designing a “iPhone 9”: a device based on iPhone 8, but with Face ID capabilities. In our case, we will be utilizing this flexibility, along with some quirks of the simulator, to grant the device it is emulating capabilities it does not have in real life. This makes the iOS Simulator much easier to mess with: by relaxing protections in macOS–which, on production iOS hardware is designed to be impossible–we can make modifications that would usually require a jailbreak had they been performed on iOS. Of course, the largest difference is that the iOS Simulator runs on a Mac, sharing the kernel with macOS but running in a separate Mach bootstrap context and its own set of processes (kicked off by launchd_sim).
While the simulator’s fidelity in reproducing a real iOS device has slowly improved over the years, there are still a couple of differences in the two environments: although many of the system frameworks are quite similar across both, the iOS Simulator comes with a stripped-down set of applications in addition, though features such as 3D Touch, location, and biometric authentication can be simulated, other sensors (including the camera, accelerometer, barometer, and magnetometer) are not emulated.
The iOS Simulator, which ships as part of Xcode, gives developers a way to test their apps without needing to run them on a physical device. Mocking Capabilities in the iOS Simulator