ios - 如何从命令行在模拟器中注册 Touch ID?

标签 ios xcode cucumber frank

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

我尝试了一些没有用的东西:

  • xcrun simctl 没有 Touch ID 选项
  • 用于控制菜单的 AppleScript 不起作用,因为 osascript 没有辅助功能权限(而且我不喜欢 this invasive workaround)
  • 我尝试在启动前编辑模拟器的 plist,但找不到合适的键值对

如果重要的话,我将使用 Frank 和 Cucumber 进行测试。

最佳答案

xcrun simctl spawn 'iPhone X' notifyutil -s com.apple.BiometricKit.enrollmentChanged '1' && xcrun simctl spawn 'iPhone X' notifyutil -p com.apple.BiometricKit.enrollmentChanged

这将登记指纹。代码取自 here

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

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

关于ios - 如何从命令行在模拟器中注册 Touch ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40117907/

相关文章:

ios - 排序数组的结果是意外的

ios - 使用 UIAlertControllerStyle.ActionSheet 在 UIAlertController 中取消按钮

java - 如何通过命令行向testng xml传递参数

java - cucumber Java : Features File Mapping to Step Definitions

cucumber - 运行 Cucumber 功能文件时出错未知选项 : --plugin

ios - UIbutton 标题上的自定义字体剪裁在单词顶部

ios - 在同一 View Controller 类之间传递数据

ios - 使用 GL_POINTS 通过 OpenGL 改变线宽 (iOS)

ios - 使用 SceneKit 进行实时连续动画

ios - 重新加载 TableView 时获取索引错误