Open andrelugomes opened 7 years ago
2016-11-30 13:52:40.682 iOSDeviceManager[7950:129941] Creating the test bundle connection.
2016-11-30 13:52:40.683 iOSDeviceManager[7950:129941] Listening for proxy connection request from the test bundle (all platforms)
2016-11-30 13:52:40.683 iOSDeviceManager[7950:129941] Resuming the test bundle connection.
2016-11-30 13:52:40.683 iOSDeviceManager[7950:129753] Checking test manager availability...
2016-11-30 13:52:40.683 iOSDeviceManager[7950:129753] Starting test session with ID AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
2016-11-30 13:52:40.720 iOSDeviceManager[7950:129807] testmanagerd handled session request using protcol version 22.
2016-11-30 13:52:41.410 iOSDeviceManager[7950:129808] Disconnected from test manager daemon socket
2016-11-30 13:52:41.411 iOSDeviceManager[7950:129753] Bundle Connection Disconnected in state 'connecting'
2016-11-30 13:52:41.515 iOSDeviceManager[7950:129753] Test Completed with Result: Bundle Connection Failed in error: Error Domain=com.facebook.XCTestBootstrap Code=4 "Lost connection to test process with state 'connecting'" UserInfo={NSLocalizedDescription=Lost connection to test process with state 'connecting'}
2016-11-30 13:52:41.515 iOSDeviceManager[7950:129753] Err: Error Domain=com.facebook.XCTestBootstrap Code=0 "Test Manager Connection Failed: Internal Error Error Domain=com.facebook.XCTestBootstrap Code=4 "Lost connection to test process with state 'connecting'" UserInfo={NSLocalizedDescription=Lost connection to test process with state 'connecting'}" UserInfo={NSLocalizedDescription=Test Manager Connection Failed: Internal Error Error Domain=com.facebook.XCTestBootstrap Code=4 "Lost connection to test process with state 'connecting'" UserInfo={NSLocalizedDescription=Lost connection to test process with state 'connecting'}, NSUnderlyingError=0x7fdd5b3c45e0 {Error Domain=com.facebook.XCTestBootstrap Code=4 "Lost connection to test process with state 'connecting'" UserInfo={NSLocalizedDescription=Lost connection to test process with state 'connecting'}}}
Can you open the DeviceAgent app manually or does it crash on launch?
Is there anything in your device logs that indicates the DeviceAgent has crashed?
DeviceAgent open and still opened with a Black screem
@andrelugomes I had a similar issue, and fixed it by ensuring that the phone and laptop were on the same wifi network. Maybe this will work for you as well.
I had the same issue running the tests on a mac to a simulator on the same mac. Everything was working fine until one day it wasn't and I got the error. The issue was caused by the mac (which was using DHCP) getting a new IP address. My test launch script was still specifying the old IP address with the DEVICE_ENDPOINT parameter. Once I updated the DEVICE_ENDPOINT IP address the problem was solved.
@jaysacco I will try. Thantk
I'm getting the exact same issue, my mac and iPhone are under the same network, everytime I run start_test_server_in_background
or cucumber
, DeviceAgent will open and quit in a flash and then no response after that, the console just keep waiting for the health check from DeviceAgent.
I am getting the same error, too. I am running iPad simulator on my Mac, therefore they should be on the same network. I tried to pass DEVICE_ENDPOINT IP to cucumber
command, but with no effect.
@jaysacco how to update DEVICE_ENDPOINT IP properly pls?
For the simulator, use the ip address of the mac the simulator is running on: DEVICE_ENDPOINT=http://"ip address of mac":37265 e.g. DEVICE_ENDPOINT=http://10.8.8.243:37265
I am facing the same issue even if i have same ip for simulator and mac.
If you are targeting a simulator, there should be no need to set the DEVICE_ENDPOINT - it will default to http://127.0.0.1:37265. If you are having problems connecting to simulators, you could try http://localhost:37265.
I want to make sure that no one in this thread is use Xcode 8.3 beta - it is not supported yet.
It is possible that the simulator is in a bad state. Try:
$ bundle exec run-loop simctl manage-processes
You can also try rebooting the machine.
You can watch the simulator logs using:
$ bundle exec run-loop simctl tail
^ that will tell you more information about what is going wrong.
Still i am getting the below error
Could not connect to the DeviceAgent service.
device: #<Simulator: iPhone 6s (10.0) 8B279B5B-E70A-4080-94EC-A7FB62940717 x86_64> url: http://127.0.0.1:27753/
To diagnose the problem tail the launcher log file:
$ tail -1000 -F /Users/pawan.lingutla/.calabash/iOSDeviceManager/logs/current.log
from /Library/Ruby/Gems/2.0.0/gems/run_loop-2.3.1/lib/run_loop/device_agent/client.rb:1305:in `rescue in launch_cbx_runner'
27753 may be the wrong port number. On my system it's 37265. Using 127.0.0.1 didn't work for me. When using the simulator, I set DeviceAgent as noted in my previous post above and it works.
port 27753
This is the DeviceAgent port. It is an application running on the simulator or device.
port 37265
This is the LPServer port - it is an embedded HTTP server inside your application.
from /Library/Ruby/Gems/2.0.0/gems/run_loop-2.3.1/lib/run_loop/device_agent/client.rb:1305:in `rescue in launch_cbx_runner'
You are using Apple's system ruby which is not supported.
https://github.com/calabash/calabash-ios/wiki/Ruby-on-MacOS
We recommend that use rbenv
.
I'm getting the same issue - pretty much exactly as ghvg1313 described, except I'm using a Simulator.
macOS Sierra 10.12.4 Xcode 8.2.1
calabash-cucumber 0.20.4 run_loop 2.4.1
iPhone 6s Simulator, 9.1 iPhone 6s Simulator, 10.2
In one test run consisting of multiple feature files, each with multiple scenarios, usually the first scenario passes without any problems, then the second scenario fails with the error mentioned above Could not connect to the DeviceAgent service....
. Following this scenarios randomly pass/fail due to this error.
This issue is preventing me running any tests at all on iOS 10.x, my current stable setup is still on El Capitan with Xcode 7.3
@jmoody Any thoughts? I've noticed this issue has been open for a while and there have been multiple releases (of run loop and calabash) since then.
For anyone else having the same issue, @jmoody 's suggested fix here - https://github.com/calabash/run_loop/issues/618#issuecomment-295177927 has helped solve the issue for me.
I've added another sleep at the end.
What about for real devices....?
Getting the same error with the below configuration: OSX: Sierra 10.12.5 ruby 2.4.1 run_loop 2.4.1 xcode 8.2.1 Both Machine and real device are on same network Provided DEVICE_TARGET, DEVICE_ENDPOINT, BUNDLE_ID parms. From last 2 days we are receiving the error message: [7/5/2017 10:18 PM] Michael Hunter: RuntimeError: Could not connect to the DeviceAgent service. device: #<Device: iPod touch (9.3.5) a6d7fffa06404f5c782cf2bb7538f5667bf54276> url: http://10.1.10.24:27753/ To diagnose the problem tail the launcher log file: $ tail -1000 -F /Users/automationtesting/.calabash/iOSDeviceManager/logs/current.log
Please suggest resolution. Thanks in advance.
I'm experiencing the same problem while trying to run on a real iOS device - No errors in the log last line is
/usr/bin/xcrun codesign -d --entitlements :- /Users/hydrafox/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/run_loop-2.5.4/lib/run_loop/device_agent/ipa/DeviceAgent-Runner.app
Please trying running that command and reporting the output.
$ /usr/bin/xcrun codesign -d --entitlements :- /Users/hydrafox/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/run_loop-2.5.4/lib/run_loop/device_agent/ipa/DeviceAgent-Runner.app
why can not connect to deviceagent ......
calabash-ios 0.21.6 run_loop 3.0.0 macos 10.13.6 ruby 2.3.4p301 xcode 9.3.1
curl http://172.22.76.188:27753/1.0/health
-- timeout
safari of iphone7, visit http://localhost:27753/1.0/health
-- return {"status":"calash is ready and waitng" }
curl http://172.22.76.188:37265/version {"device_family":"iPhone","outcome":"SUCCESS","server_port":37265,"simulator":"","app_name":"大众点评","app_version":"10.5.0","screen_dimensions":{"height":1334,"bounds":{"y":0,"x":0,"width":375,"height":667},"sample":1,"native_bounds":{"y":0,"x":0,"width":750,"height":1334},"width":750,"native_scale":2,"bounds_portrait_height":667,"bounds_portrait_width":375,"scale":2},"git":{"revision":"988abad","remote_origin":"git@github.com:calabash\/calabash-ios-server.git","branch":"tag\/0.21.6"},"device_name":"iPhone 7","4inch":false,"app_id":"com.dianping.dpscope","form_factor":"iphone 6","version":"0.21.6","server_identifier_to_skip":"","short_version_string":"10.5.0","server_identifier":"988abadaed90380c41da4d36aab1f08d0e217879","build_date":"2018-24-05 08:17:17 +0200","ios_version":"10.0.1","iphone_app_emulated_on_ipad":false,"model_identifier":"iPhone9,1","app_base_sdk":"iphoneos11.3"}
XCode Version 8.1 (8B62) MacOS 10.12.1 (16B2555) SIERRA Calabash sandbox version: 0.1.18
Bundle updated!
Done! Now the sandbox contains: calabash-ios: 0.20.3 calabash-android: 0.8.4 xamarin-test-cloud: 2.1.0
Verifying Calabash : curl -v http://192.168.153.86:37265/version
Running Console:
Starting Server test
calabash-ios 0.20.3> start_test_server_in_background