如何从命令行在Simulator中注册Touch ID?

Aar*_*ger 11 xcode cucumber ios frank

我想从命令行在iOS模拟器中注册Touch ID,这样我就可以围绕授权运行一些自动UI功能测试.

我尝试了一些不起作用的东西:

  • xcrun simctl 没有Touch ID选项
  • 用于控制菜单的AppleScript无法正常工作,因为osascript没有可访问权限(我不喜欢这种侵入性的解决方法)
  • 我尝试在启动之前编辑模拟器的plist,但找不到合适的键值对

如果重要的话,我正在使用Frank和Cucumber进行测试.

Pav*_*vol 5

xcrun simctl spawn 'iPhone X' notifyutil -s com.apple.BiometricKit.enrollmentChanged '1' && xcrun simctl spawn 'iPhone X' notifyutil -p com.apple.BiometricKit.enrollmentChanged
Run Code Online (Sandbox Code Playgroud)

这将注册指纹。代码取自这里

编辑:您可以将其用于手指触摸:

xcrun simctl spawn 'iPhone X' notifyutil -p com.apple.BiometricKit_Sim.fingerTouch.match
xcrun simctl spawn 'iPhone X' notifyutil -p com.apple.BiometricKit_Sim.fingerTouch.nomatch
Run Code Online (Sandbox Code Playgroud)