Search code examples
rubycucumberxcode7calabashcalabash-ios

Upgrading to iOS 9.1 simulator makes Calabash not recognize the device target


xcode installation location: /Applications/Xcode.app/Contents/Developer

xcode version: Xcode 7.2 Build version 7C68

calabash version: 0.16.4

calabash.framework version: `0.16.4`
profiling: /Users/moody/git/calabash/calabash-ios-server/build/framework/version-tool/Build/Intermediates/calabash.build/Debug/version.build/Objects-normal/x86_64/main.gcda: cannot open: No such file or directory
profiling: /Users/moody/git/calabash/calabash-ios-server/build/framework/version-tool/Build/Intermediates/calabash.build/Debug/version.build/Objects-normal/x86_64/main.gcda: cannot open: No such file or directory
profiling: /Users/moody/git/calabash/calabash-ios-server/build/framework/version-tool/Build/Intermediates/calabash.build/Debug/version.build/Objects-normal/x86_64/main.gcda: cannot open: No such file or directory
profiling: /Users/moody/git/calabash/calabash-ios-server/build/framework/version-tool/Build/Intermediates/calabash.build/Debug/version.build/Objects-normal/x86_64/main.gcda: cannot open: No such file or directory

(I'm getting the top text after I upgraded from 0.14.3 to 0.16.4, before that it would only tell me 0.14.3 without the extra stuff)

Here's the problem: When I updated the Simulator version in Xcode and in our 01_launch.rb from 8.4 to 9.1, my calabash features will not run. Here is the error I'm getting:

No device_target was specified and did not detect a connected device. Set a device_target option in the relaunch method. (RuntimeError)
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:684:in `default_uia_strategy'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:627:in `relaunch'
  /Users/myname/Development/sprayerMobile/SprayMobile/features/support/01_launch.rb:35:in `Before'
Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2) for "localhost" port 37265 (http://localhost:37265))
Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2) for "localhost" port 37265 (http://localhost:37265))
Failing... Errno::ECONNREFUSED
  Connection refused - connect(2) for "localhost" port 37265 (http://localhost:37265) (Errno::ECONNREFUSED)
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient/session.rb:799:in `initialize'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient/session.rb:799:in `new'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient/session.rb:799:in `create_socket'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient/session.rb:747:in `block in connect'
  /Users/myname/.rbenv/versions/2.2.3/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
  /Users/myname/.rbenv/versions/2.2.3/lib/ruby/2.2.0/timeout.rb:98:in `call'
  /Users/myname/.rbenv/versions/2.2.3/lib/ruby/2.2.0/timeout.rb:98:in `timeout'
  /Users/myname/.rbenv/versions/2.2.3/lib/ruby/2.2.0/timeout.rb:124:in `timeout'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient/session.rb:746:in `connect'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient/session.rb:612:in `query'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient/session.rb:164:in `query'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient.rb:1191:in `do_get_block'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient.rb:974:in `block in do_request'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient.rb:1082:in `protect_keep_alive_disconnected'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient.rb:969:in `do_request'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient.rb:822:in `request'
  /Users/myname/.calabash/gems/httpclient-2.6.0.1/lib/httpclient.rb:725:in `post'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/http_helpers.rb:57:in `block in make_http_request'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/http_helpers.rb:50:in `times'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/http_helpers.rb:50:in `make_http_request'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/http_helpers.rb:29:in `http'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/connection_helpers.rb:11:in `http'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/map.rb:71:in `raw_map'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/map.rb:23:in `map'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/core.rb:112:in `query'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/tests_helpers.rb:23:in `element_does_not_exist'
  /Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/tests_helpers.rb:30:in `element_exists'
  /Users/myname/Development/company/Company/features/support/01_launch.rb:43:in `Before'

This error goes away when I switch back to 8.4 Has anyone experienced this, or maybe knows of a way to fix this issue? To me it seems like a simulator issue, since when I switch back b/w the simulators, in 9.1 I get those errors, where with 8.4 my features run fine.. but my coworker put in some Xcode 7 updates that I pulled into my code, so it's possible that it has to do with his updates too...

As an aside, why is it refering to 0.14.3 gems if I upgraded to 0.16.4?

*Update

When I add DEBUG=1 before running features, I get these warnings:

WARN: deprecated '1.5.0' - Replaced with RunLoop::Xcode
/Users/myname/.calabash/gems/run_loop-1.5.6/lib/run_loop/xctools.rb:183:in `xcode_version_gte_51?'
/Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:490:in `default_launch_method'
/Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:420:in `default_launch_args'
/Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:534:in `relaunch'
/Users/myname/Development/sprayerMobile/SprayMobile/features/support/01_launch.rb:36:in `block in <top (required)>'
WARN: deprecated '1.5.0' - Replaced by RunLoop::Xcode
/Users/myname/.calabash/gems/run_loop-1.5.6/lib/run_loop/sim_control.rb:21:in `xctools'
/Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:666:in `default_uia_strategy'
/Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:627:in `relaunch'
/Users/myname/Development/sprayerMobile/SprayMobile/features/support/01_launch.rb:36:in `block in <top (required)>'
/Users/myname/.calabash/gems/cucumber-1.3.20/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
WARN: deprecated '1.5.0' - Replaced with RunLoop::Instruments
/Users/myname/.calabash/gems/run_loop-1.5.6/lib/run_loop/xctools.rb:265:in `instruments'
/Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:666:in `default_uia_strategy'
/Users/myname/.calabash/gems/calabash-cucumber-0.14.3/lib/calabash-cucumber/launcher.rb:627:in `relaunch'
/Users/myname/Development/sprayerMobile/SprayMobile/features/support/01_launch.rb:36:in `block in <top (required)>'
/Users/myname/.calabash/gems/cucumber-1.3.20/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'

Any help would be appreciated!


Solution

  • After installing a new Xcode or moving/renaming an Xcode installation, you need to restart your machine.

    You have a mismatch between the gem version (0.14.3) and the server version in your app (0.16.4). Please see the Updating your Calabash iOS version.

    I believe that your run-loop version is not compatible with Xcode 7.2.

    If you are not using a Gemfile, we recommend that you start.