SPB Git

Repository Public

biometry-check.sh 2.9 KB 66 lines shellscript

1#!/usr/bin/env bash2# =============================================================================3#                  SP BOUCHER | SOFTWARE & RESEARCH4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project          : SP ID & Card Vault8# File             : scripts/biometry-check.sh9# Module           : Scripts10# Repository       : https://git.spboucher.ai/sp-id-card-vault11# Project Website  : Not specified12# Created          : 2026-12-0213# Last Modified    : 2026-12-0214#15# Author           : Simon-Pierre Boucher16# Position         : Professor of Finance17# Institution      : Université du Québec en Outaouais (UQO)18# Organization     : SP Boucher19# Website          : https://spboucher.ai20# Git              : https://git.spboucher.ai21#22# Preferred Contact: contact@spboucher.ai23# Development      : dev@spboucher.ai24# Support          : support@spboucher.ai25# Security/Admin   : admin@spboucher.ai26#27# Copyright (c) 202628# Simon-Pierre Boucher29# All rights reserved where applicable. This file is governed by the30# applicable project license, copyright notices and relevant law.31# Existing third-party rights and notices remain unaffected.32#33# License          : None specified (no license file in this repository)34#35# Do not embed credentials, private keys, access tokens,36# certificates or confidential personal information.37#38# =============================================================================39# END OF SP BOUCHER SOURCE HEADER40# =============================================================================4142# Runs the real-LAContext UI tests in the simulator while this script plays the43# face: it enrols Face ID, then posts "matching face" during the first test and44# "non-matching face" during the second. usage: scripts/biometry-check.sh45set -uo pipefail46cd "$(dirname "$0")/.."47SIM="${SPV_SIM:-SPVault iPhone}"; DD="${SPV_DD:-build/dd}"48post() { xcrun simctl spawn "$SIM" notifyutil -p "$1" >/dev/null 2>&1; }49face() { # $1 = match|nomatch, runs until killed50  while true; do post "com.apple.BiometricKit_Sim.pearl.$1"; sleep 1; done51}52xcrun simctl bootstatus "$SIM" -b >/dev/null 2>&153xcrun simctl uninstall "$SIM" ai.spboucher.idcardvault >/dev/null 2>&1 || true54xcrun simctl spawn "$SIM" notifyutil -s com.apple.BiometricKit.enrollmentChanged 155post com.apple.BiometricKit.enrollmentChanged56run() { # $1 = test name, $2 = match|nomatch57  face "$2" & local pid=$!58  TEST_RUNNER_SPV_REAL_BIOMETRY=1 xcodebuild -project SPVault.xcodeproj -scheme SPVault \59    -destination "platform=iOS Simulator,name=$SIM" -derivedDataPath "$DD" test \60    -only-testing:"SPVaultUITests/RealBiometryUITests/$1" 2>&1 | grep -E "Test Case .*(passed|failed)|error:|skipped" | cut -c1-22061  kill $pid >/dev/null 2>&1; wait $pid 2>/dev/null62}63xcodegen generate >/dev/null64run testMatchingFaceUnlocks match65run testNonMatchingFaceStaysLocked nomatch66
Files main
Menu

Theme