2
  • xcode installation location: /Applications/Xcode.app/Contents/Developer
  • xcode version: 6.0.1
  • calabash version: 0.11.0
  • calabash.framework version: 0.10.2
  • I do not have a firewall turned on
  • I have no problems running this on the simulator

Console output:

$ DEVICE_TARGET=xxxx DEVICE_ENDPOINT=192.168.2.2 BUNDLE_ID=xxxx CALABASH_FULL_CONSOLE_OUTPUT=1 DEBUG=1 MAX_CONNECT_RETRY=2  calabash-ios console
Running irb...
irb(main):001:0> start_test_server_in_background

INFO: Using uia strategy: 'preferences'
Sending 'QUIT' to instruments process '57313'
Waiting for instruments '57313' to terminate
Preparation took 1.071744 seconds
{
                    :app => "xxxx",
                   :args => [],
:bundle_dir_or_bundle_id => "xxxx",
              :bundle_id => "xxxx",
                 :device => "xxxx",
          :device_target => "xxxx",
          :launch_method => :instruments,
         :launch_retries => 5,
               :log_file => "/var/folders/gy/qpky9m857fxcvf_y35m30_s80000gp/T/run_loop20141006-57357-15h8el1/run_loop.out",
              :no_launch => false,
                :no_stop => false,
                  :reset => false,
            :results_dir => "/var/folders/gy/qpky9m857fxcvf_y35m30_s80000gp/T/run_loop20141006-57357-15h8el1",
      :results_dir_trace => "/var/folders/gy/qpky9m857fxcvf_y35m30_s80000gp/T/run_loop20141006-57357-15h8el1/trace",
                 :script => "/var/folders/gy/qpky9m857fxcvf_y35m30_s80000gp/T/run_loop20141006-57357-15h8el1/_run_loop.js",
            :sdk_version => nil,
                   :udid => "xxxx",
           :uia_strategy => :preferences,
                  :xcode => "6.0.1",
             :xcode_path => "/Applications/Xcode.app/Contents/Developer"
}

### Starting on xxxx App: xxxx ###
2014-10-06 16:56:06 +0100 xcrun instruments -w "xxxx" -D     "/var/folders/gy/qpky9m857fxcvf_y35m30_s80000gp/T/run_loop20141006-57357-15h8el1/trace" -t "Automation" "xxxx" -e UIARESULTSPATH /var/folders/gy/qpky9m857fxcvf_y35m30_s80000gp/T/run_loop20141006-57357-15h8el1 -e UIASCRIPT /var/folders/gy/qpky9m857fxcvf_y35m30_s80000gp/T/run_loop20141006-57357-15h8el1/_run_loop.js  &> /var/folders/gy/qpky9m857fxcvf_y35m30_s80000gp/T/run_loop20141006-57357-15h8el1/run_loop.out
Launching took 3.630218 seconds
Waiting for App to be ready
Timed out after 30 secs, trying to connect to Calabash server...
Will retry 1
Timed out after 30 secs, trying to connect to Calabash server...
Will retry 0
#<RuntimeError: Timed out connecting to Calabash server after 2 retries. Make sure it is  linked and App isn't crashing>
RuntimeError: Unable to make connection to Calabash Server at 192.168.2.2
Make sure you don't have a firewall blocking traffic to 192.168.2.2.

    from /Users/xxx/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/calabash-cucumber-0.11.0/lib/calabash-cucumber/launcher.rb:778:in `rescue in ensure_connectivity'
from /Users/xxx/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/calabash-cucumber-0.11.0/lib/calabash-cucumber/launcher.rb:740:in `ensure_connectivity'
from /Users/xxx/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/calabash-cucumber-0.11.0/lib/calabash-cucumber/launcher.rb:608:in `relaunch'
from /Users/xxx/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/calabash-cucumber-0.11.0/lib/calabash-cucumber/core.rb:838:in `start_test_server_in_background'
from (irb):1
from /Users/xxx/.rbenv/versions/2.0.0-p247/bin/irb:12:in `<main>'

What I see on the device:

  • The app boots up completely.

What I have tried:

  • Restarting machine and device multiple times
  • Trying device in multiple usb ports
  • Trying with xcode in various states (connected to device, not connected to device etc)
  • Connecting device to a private wifi hosted by my machine

All of the above give the same result.

As far as I can tell the ping_app method is not returning a 200 so that the status becomes connected=true. When I ping the app manually using a rest client over port 37265 I get http status of 405 returned.

Is there something I am missing on my machine/network set up that is preventing the ping_app method from giving the expected response?

scosbet
  • 23
  • 5
  • Are you building the app from xcode on the device directly? Do you see the server started on 37265 message in the console logs? And last of all, is the device running iOS 8.0? – ucsunil Oct 06 '14 at 16:55
  • @Sunil Yes I'm building directly from xcode. I see this in the logs: "Started LPHTTP server on port 37265". No the device is running 7.1.1 – scosbet Oct 07 '14 at 09:28
  • Can you try it out with this DEVICE_ENDPOINT=http://192.168.2.2:37265 (there's an "http://" before the ip but SO doesn't display it and instead shows this as a link). It's mentioned in the official docs and it's always worked for me. I can't think of anything else. – ucsunil Oct 07 '14 at 17:28

4 Answers4

0

You have to add the port number that Calabash uses which is 37265. Also make sure your device and your machine are both on the same router and that there's no firewall. I use a Mac so i just create a new network on my machine and join it on my device. Hope this helps.

Try reviewing this link to make sure your setup is correct. https://github.com/calabash/calabash-ios#installation-details

king_wayne
  • 222
  • 1
  • 9
  • If you are suggesting that I try something like this: DEVICE_ENDPOINT=192.168.2.2:37265 then unfortunately this solution doesn't work. I have also tried creating a network on my machine but I still get the same result. @KingWayne – scosbet Oct 07 '14 at 12:48
0

The proper format is:

DEVICE_ENDPOINT=http://192.168.2.2:37265

You can test that the server is running using:

$ curl http://192.168.2.2:37265/version
jmoody
  • 2,480
  • 1
  • 16
  • 22
  • Making this change in combination with hosting a private network from my machine did the trick – scosbet Oct 09 '14 at 09:35
  • I've been contacted by my colleague with regards to this post: http://stackoverflow.com/questions/26014651/launching-photo-screen-a-second-time-on-ios8-when-calabash-ios-is-linked Am using the comment here as I have no idea how else to contact you about it. Please drop me an email (address on my profile) so I can send you the sample app. @jmoody – scosbet Nov 20 '14 at 12:38
0

To launch calabash iOs tests on the real device you should go to the Settings--> Developer--> Enable UI Automation set as ON

Nikolay Kostov
  • 16,433
  • 23
  • 85
  • 123
0

Some useful tips:

  • Device Endpoint: Must have :37265 at the end of it (The calabash server)

  • If you name your device in iTunes: like myPhone you can set Device Endpoint=http://myPhone.local:37265. Device name cannot have _ or .'s.

  • Make sure that your Mac and your Device are on the same wifi