如何告诉 Calabash 在模拟器......慢慢......开始运动时不要超时?

How to tell Calabash to NOT timeout while the simulator... slowly... grinds into motion?

上下文

我有一个 Mac Mini 运行 Xcode,以及一系列使用 Calabash 的 Cucumber 测试 运行。

问题

他们失败了,因为模拟器需要很长时间(可能是 50 秒)才能启动 运行。我已经尝试传递 timeout 启动选项(根据文档将它们传递到我的调用之前)但我仍然失败,而且我还没有理解如何在 calabash-ios console模式。

我正在通读源代码,希望找到未记录的内容 here

实际上 this question 我没有取得任何进展:

calabash-ios console
> Running irb...
> irb(main):001:0> start_test_server_in_background(:timeout => 6000)
> RunLoop::Xcrun::TimeoutError: Xcrun timed out after 30.30 seconds executing
> xcrun instruments -s templates
> with a timeout of 30

我可以完全禁用启动超时吗?我该怎么做(保存编辑葫芦源...)?

这不是很明显,但有办法。来自 xcrun.rb (which is actually in the run_loop gem),

# You can override these values if they do not work in your environment.
#
# For cucumber users, the best place to override would be in your
# features/support/env.rb.
#
# For example:
#
# RunLoop::Xcrun::DEFAULT_OPTIONS[:timeout] = 60

如果这对您不起作用,请告诉我。

就完全禁用它而言,我认为为超时使用一个巨大的值更容易。但请记住,超时是有原因的。如果您的模拟器实际上卡住了并且由于某种原因无法启动,那么有一些超时来保释是合理的。

unbearably slow

您必须更新到新机器。我推荐一个 SSD 驱动器 - 它会真正加快您的模拟器测试。

RunLoop::Xcrun::DEFAULT_OPTIONS[:timeout] 外,请参阅 RunLoop::CoreSimulator::DEFAULT_OPTIONS

  # These options control various aspects of an app's life cycle on the iOS
  # Simulator.
  #
  # You can override these values if they do not work in your environment.
  #
  # For cucumber users, the best place to override would be in your
  # features/support/env.rb.
  #
  # For example:
  #
  # RunLoop::CoreSimulator::DEFAULT_OPTIONS[:install_app_timeout] = 60
  DEFAULT_OPTIONS = {
    # In most cases 30 seconds is a reasonable amount of time to wait for an
    # install.  When testing larger apps, on slow machines, or in CI, this
    # value may need to be higher.  120 is the default for CI.
    :install_app_timeout => RunLoop::Environment.ci? ? 120 : 30,
    :uninstall_app_timeout => RunLoop::Environment.ci? ? 120 : 30,
    :launch_app_timeout => RunLoop::Environment.ci? ? 120 : 30,
    :wait_for_state_timeout => RunLoop::Environment.ci? ? 120 : 30
  }