0

I am trying to start the test server I am getting the below error. Could you please some one give me the solution. I tried different combination of gem versions but no luck. Appreciated quick help on this.

I am using command something like

DEVICE_TARGET='iPhone 5 (9.2)' calabash-ios console


irb(main):001:0> start_test_server_in_background

ArgumentError: Could not find a device with a UDID or name matching 'iPhone' from /Users/test/.rvm/gems/ruby-2.0.0-p353/gems/run_loop-2.1.1/lib/run_loop/device.rb:126:in device_with_identifier' from /Users/test/.rvm/gems/ruby-2.0.0-p353/gems/run_loop-2.1.1/lib/run_loop/device.rb:160:indetect_device' from /Users/test/.rvm/gems/ruby-2.0.0-p353/gems/run_loop-2.1.1/lib/run_loop/core.rb:71:in run_with_options' from /Users/test/.rvm/gems/ruby-2.0.0-p353/gems/run_loop-2.1.1/lib/run_loop.rb:134:inrun' from /Users/test/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.18.1/lib/calabash-cucumber/launcher.rb:718:in block in new_run_loop' from /Users/test/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.18.1/lib/calabash-cucumber/launcher.rb:716:intimes' from /Users/test/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.18.1/lib/calabash-cucumber/launcher.rb:716:in new_run_loop' from /Users/test/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.18.1/lib/calabash-cucumber/launcher.rb:584:inrelaunch' from /Users/test/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.18.1/lib/calabash-cucumber/core.rb:943:in start_test_server_in_background' from (irb):1 from /Users/test/.rvm/rubies/ruby-2.0.0-p353/bin/irb:12:in'

ketan
  • 19,129
  • 42
  • 60
  • 98
apparao
  • 5
  • 5

1 Answers1

0

UPDATE

From your comment, it appears you are trying to launch on a physical device, not a simulator. This is confusing because "iPhone 5 (9.2)" has the same naming convention as a simulator.

When you target a physical device, you need to use the UDID of the device, which you can find in the first few lines of output of instruments:

$ xcrun instruments -s devices
stern [4AFA58C7-5D39-54D0-9733-04302E7XXXXX]
neptune (9.3.1) [43be3f89d9587e9468c24672777ff6241bdXXXXX]
uranus (9.3.1) [6c3ed5434b5dfc29758f8835644b55bd43XXXXX]
Apple TV 1080p (9.0) [D6875A98-2C0E-4138-85EF-841025A54DE0] (Simulator)
# the rest are simulators.

In the example above:

* stern is the host computer.
* neptune and uranus are physical devices.

To target neptune:

$ DEVICE_TARGET=43be3f89d9587e9468c24672777ff6241bdXXXXX \
  DEVICE_ENDPOINT=http://<ip of your device>:37265 \
  calabash-ios console

If you name your devices sensibly, you can also do this:

$ DEVICE_TARGET=neptune \
  DEVICE_ENDPOINT=http://<ip of your device>:37265 \
  calabash-ios console

I suspect that because your physical device name exactly matches a simulator name, Calabash is confused about what device you want to target.

To recap: You have two options:

 1. Use the UDID you get from instruments.
 $ DEVICE_TARGET=43be3f89d9587e9468c24672777ff6241bdXXXXX \
   DEVICE_ENDPOINT=http://<ip of your device>:37265 \
   calabash-ios console

 2. Rename your device to something like "iphone5"
 $ DEVICE_TARGET=iphone5 \
   DEVICE_ENDPOINT=http://<ip of your device>:37265 \
   calabash-ios console

You might find the Testing on Physical Devices wiki page helpful.

Previous Answer

Have you tried "quotes?

$ DEVICE_TARGET="iPhone 5 (9.2)" calabash-ios console

ArgumentError: Could not find a device with a UDID or name matching 'iPhone' from

For some reason, run-loop is missing the "5 (9.2)" portion of the string.

The only other thing I can think of is that you don't have an iPhone 5 iOS 9.2 simulator installed. Do you see one in Xcode?

You can also try using the UDID directly.

# List the available simulators
$ xcrun instruments -s devices
<snip>
iPhone 6 Plus (9.3) [D6AFEDFE-2E02-4A33-AEC8-740053DDC6DE] (Simulator)

 # Use the UDID directly.
 $ DEVICE_TARGET="D6AFEDFE-2E02-4A33-AEC8-740053DDC6DE" calabash-ios console
jmoody
  • 2,480
  • 1
  • 16
  • 22
  • After trying with double quotes also i am getting the same error as below:DEVICE_TARGET="A45EB390-9BE5-4B49-A933-E1F91B5334CA" 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 'iphone' from /Users/.rvm/gems/ruby-2.0.0-p353/gems/run_loop-2.1.1/lib/run_loop/device.rb:126:in `device_with_identifier' from /Users/.rvm/gems/ruby-2.0.0-p353/gems/run_loop-2.1.1/lib/run_loop/device.rb:160:in `detect_device' – apparao May 11 '16 at 18:05
  • I have connected device using USB and able to see that device in XCODE with name - iPhone 5 (9.2). But still it is not working. Is there any problem with gem versions? – apparao May 11 '16 at 20:26
  • Updated my answer based on your comment. – jmoody May 12 '16 at 05:55
  • I have deleted the simulator and tried to start the test server in background the application is opening and getting the login page but i am not getting next prompt to query my objects , it is waiting at below step and unable to continue further irb(main):002:0> start_test_server_in_background – apparao May 12 '16 at 17:15
  • If i am opening the app and trying to query the objects i am getting below error:Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2) (localhost:37265)) Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2) (localhost:37265)) Failing... Errno::ECONNREFUSED – apparao May 12 '16 at 17:15
  • > deleted the simulator - you probably should have renamed the device; you might need that simulator later. > connection refused - You need to set the DEVICE_ENDPOINT. To see how to do this follow the instructions on the wiki page I linked to in my answer. – jmoody May 12 '16 at 17:17
  • In Xcode i am able to connect the 37265 server and getting following cmds in console:Creating the server: 2016-05-12 10:06:14.083 DEBUG CalabashServer:239 | Calabash iOS server version: CALABASH VERSION: 0.18.1 2016-05-12 10:06:14.083 DEBUG CalabashServer:242 | App Base SDK: iphoneos9.2 2016-05-12 10:06:14.083 DEBUG CalabashServer:274 | IPHONE_SIMULATOR_ROOT: (null) 2016-05-12 10:06:14.089 DEBUG CalabashServer:260 | Calabash iOS server is listening on: 192.168.43.163 port 37265 – apparao May 12 '16 at 17:23
  • We are beyond the scope of this question. Please open a new question. If I solved your problem, please mark my answer as correct. – jmoody May 12 '16 at 17:29
  • Thanks for providing the details. I will start other thread for the remaining issue. – apparao May 13 '16 at 17:28