无法在物理设备上启动测试服务器

Can't start test server on physical device

我在一台新机器上安装了 calabash,但在我的旧机器上测试 运行 不会 运行。

据我所知,两台机器的设置方式相同。他们从同一个存储库中提取项目,其中包括一个带有 calabash-cucumber 版本 0.18.0 的 Gemfile。我设置了相同的 BUNDLE_ID、DEVICE_ENDPOINT 和 DEVICE_TARGET 值并使用相同的物理设备。

当我尝试 运行 在新机器上的控制台中进行测试时,我得到了这个:

$ bundle exec calabash-ios console
Running irb...
irb(main):001:0> start_test_server_in_background
ArgumentError: Could not find a device with a UDID or name matching 'com.my.apps.bundle.id'
    from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/run_loop-2.1.1/lib/run_loop/device.rb:126:in `device_with_identifier'
    from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/run_loop-2.1.1/lib/run_loop/device.rb:160:in `detect_device'
    from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/run_loop-2.1.1/lib/run_loop/core.rb:71:in `run_with_options'
    from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/run_loop-2.1.1/lib/run_loop.rb:134:in `run'
    from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/launcher.rb:718:in `block in new_run_loop'
    from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/launcher.rb:716:in `times'
    from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/launcher.rb:716:in `new_run_loop'
    from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/launcher.rb:584:in `relaunch'
    from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/core.rb:943:in `start_test_server_in_background'
    from (irb):1
    from /Users/rjones/.rbenv/versions/2.1.5/bin/irb:11:in `<main>'

知道为什么这不起作用吗?

请更新至 0.19.0。

您能否也粘贴您用来启动

确切 命令
irb(main):001:0> start_test_server_in_background
ArgumentError: Could not find a device with a UDID or name matching
'com.my.apps.bundle.id'

您似乎将 DEVICE_TARGET 设置为包 ID?如果没有,那么您发现了一个错误。 0.18.0 可能与 运行-loop 2.1.1 不兼容。如果您想验证这是问题所在,请降级到 run_loop 2.0.9。

我在将黄瓜 gem 从版本 1.3.19 更新到版本 2.3.3 时遇到了同样的问题。我还 运行 在物理设备上进行测试

编辑:抱歉,忘了说,我也将 run_loop 从版本 2.0.6 更新到 2.1.3

所以版本:

run_loop (2.1.3) calabash-cucumber (0.18.1) 我猜这就是可能影响这部分的两个,cucumber 没有涉及

我找到了一个解决方案,通过设置变量 DEVICE 而不是 DEVICE_TARGET

例如:

BUNDLE_ID=<bundle_id> DEVICE=<dev_udid> DEVICE_ENDPOINT=<dev_ip> cucumber

而不是

BUNDLE_ID=<bundle_id> DEVICE_TARGET=<dev_udid> DEVICE_ENDPOINT=<dev_ip> cucumber