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

时间:2016-04-20 19:46:49

标签: calabash calabash-ios

我在新机器上安装了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>'

为什么这不起作用的任何想法?

2 个答案:

答案 0 :(得分:1)

请更新至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可能与运行循环2.1.1不兼容。如果要验证这是问题,请降级到run_loop 2.0.9。

答案 1 :(得分:0)

在将黄瓜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