HTTPClient::ConnectTimeoutError: execution expired

HTTPClient::ConnectTimeoutError: execution expired

环境:

xcode 路径:/Applications/Xcode.app/Contents/Developer
xcode 版本:Xcode 7.3
calabash-ios 版本:0.18.2
run_loop 版本:2.0.9
模拟器:iPhone 6s Plus (9.3)

从 Xcode 手动启动我的应用程序并做了:

$ curl http://localhost:37265/version
{
    "device_family": "iPhone",
    "outcome": "SUCCESS",
    "server_port": 37265,
    "simulator_devic e": "iPhone",
    "simulator": "CoreSimulator 209.19 - Device: iPhone 6s Plus -    Runtime: iOS 9.3 (13E230) - DeviceType: iPhone 6s Plus",
    "app_name": "SOTesters",
    "app_version": "11.2",
    "screen_dimensions": {
        "sample": 1,
        "height": 2208,
        "width": 1242,
        "scale": 3
    },
    "git": {
        "revision": "68026d3",
        "remote_origin": "git@github.com:calabash\/calabash-ios-server.git",
        "branch": "master"
    },
    "device_name": "iPhone Simulator",
    "4inch": false,
    "app_id": "com.goinstant.internal.SOTesters",
    "form_factor": "iphone 6+",
    "system": "x86_64",
    "version": "0.18.2",
    "iOS_version": "9.3",
    "short_version_string": "11.2",
    "ios_version": "9.3",
    "iphone_app_emulated_on_ipad": false,
    "model_identifier": "iPhone8,2",
    "app_base_sdk": "iphonesimulator9.3"
}

重现步骤
1. 将应用构建到 iPhone 6s Plus (9.3) 模拟器
2. launch DEBUG=1 DEBUG_HTTP=1 DEVICE_TARGET='iPhone 6s Plus (9.3)'calabash-ios console

irb(主):003:0> start_test_server_in_background

EXEC: xcrun strings /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app/SOTesters
INFO: Detected app at path:
 INFO: /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app
 INFO: Modification time of app: Tue 29 Mar 2016 17:20:52 ADT
 INFO: If this is incorrect, set the APP variable and/or rebuild your app
 INFO: It is your responsibility to ensure you are testing the right app.

INFO: Using uia strategy: 'host'
DEBUG: Searching for run-loop results with glob: /Users/k/.run-loop/results/*
DEBUG: Found 6 previous run-loop results
DEBUG: Will delete 1 previous run-loop results
DEBUG: Deleted 1 previous results in 0.007448 seconds
DEBUG: Searching for instruments caches with glob:     /Library/Caches/com.apple.dt.instruments/xrtmp__*
DEBUG: Found 6 instruments caches
DEBUG: Will delete 1 instruments caches
DEBUG: Deleted 1 instruments caches in 0.002827 seconds
DEBUG: Simulator instruction set 'x86_64' is compatible with '["x86_64"]'
DEBUG: Deleting /Users/k/Library/Developer/CoreSimulator/Devices/DDB1E8ED-    025F-40E5-AF6C-1A99C30729B9/data/tmp/instruments_cvg4z3/stdio.pipe
DEBUG: Installed app is the same as #<APP: /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app>
DEBUG: Launching #<Simulator: iPhone 6s Plus (9.3) DDB1E8ED-025F-40E5-AF6C-1A99C30729B9 x86_64> with:
EXEC: xcrun open -g -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID DDB1E8ED-025F-40E5-AF6C-1A99C30729B9
DEBUG: Waiting for simulator to stabilize with timeout: 30
DEBUG: Simulator stable after 4.394763 seconds
DEBUG: Waited a total of 6.394763 seconds for simulator to stabilize
DEBUG: Took 6.519767 seconds to launch the simulator
2016-03-29 22:23:23 -0300 [RunLoop:debug]:
{
                    :app => "/Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app",
                   :args => [],
:bundle_dir_or_bundle_id => "/Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app",
              :bundle_id => "com.goinstant.internal.SOTesters",
          :device_target => "iPhone 6s Plus (9.3)",
            :instruments => #<Instruments 7.3>,
          :launch_method => :instruments,
         :launch_retries => 5,
               :log_file => "/Users/k/.run-loop/results/2016-03-29_22-23-14/run_loop.out",
              :no_launch => false,
                :no_stop => false,
     :relaunch_simulator => true,
                  :reset => false,
            :results_dir => "/Users/k/.run-loop/results/2016-03-29_22-23-14",
      :results_dir_trace => "/Users/k/.run-loop/results/2016-03-29_22-23-14/trace",
                 :script => "/Users/k/.run-loop/results/2016-03-29_22-23-14/_run_loop.js",
            :sdk_version => nil,
                   :udid => "iPhone 6s Plus (9.3)",
           :uia_strategy => :host,
                  :xcode => "7.3",
             :xcode_path => "/Applications/Xcode.app/Contents/Developer"
}
EXEC: xcrun instruments -s templates

### Starting on iPhone 6s Plus (9.3) App: /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app ###
EXEC: xcrun instruments -s devices
2016-03-29 22:23:24 -0300 [RunLoop:debug]: xcrun instruments -w DDB1E8ED-025F-40E5-AF6C-1A99C30729B9 -D /Users/k/.run-loop/results/2016-03-29_22-23-14/trace -t Automation /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app -e UIARESULTSPATH /Users/k/.run-loop/results/2016-03-29_22-23-14 -e UIASCRIPT /Users/k/.run-loop/results/2016-03-29_22-23-14/_run_loop.js >& /Users/k/.run-loop/results/2016-03-29_22-23-14/run_loop.out
2016-03-29 22:23:24 -0300 [RunLoop:debug]: Preparation took 10.577951 seconds
2016-03-29 22:23:29 -0300 [RunLoop:debug]: Launching took 4.361413 seconds
DEBUG: It took 14.939501 seconds to launch the app
|

光标在那里等着,不完整。

我必须按 ctrl+c 然后 return irb>

如果我在没有 start_test_server_in_background 的情况下进行查询,我会收到超时错误

irb(main):001:0> query("*")
= Request

> ! CONNECT TO 10.10.10.10:37265
Retrying.. HTTPClient::ConnectTimeoutError: (execution expired)
= Request

`! CONNECT TO 10.10.10.10:37265
Retrying.. HTTPClient::ConnectTimeoutError: (execution expired)
= Request

> ! CONNECT TO 10.10.10.10:37265
Failing... HTTPClient::ConnectTimeoutError
HTTPClient::ConnectTimeoutError: execution expired

我基本上遵循了 https://github.com/calabash/calabash-ios/wiki/Updating-your-Calabash-iOS-version

上的所有说明

服务器版本和gem版本都是0.18.2但是还是连接不上。我在其他模拟器上尝试了 运行,但我遇到了相同的连接超时错误。

start_test_server_in_background 在 运行 query() 之前 irb 了吗?在 calabash 可以与您的应用程序交互之前,必须执行一个相当复杂的附加过程。

+1 包括所有相关信息。

您的 curl 反对 localhost,但堆栈跟踪显示:10.10.10.10:37265。这意味着您环境中的某处 DEVICE_ENDPOINT 设置为“http://10.10.10.10:37265”。

您正在使用 DEVICE_ENDPOINT=http://10.10.10.10:37265 启动 Calabash 控制台,或者 DEVICE_ENDPOINT 已导出到您的 shell。

尝试:

$ DEVICE_ENDPOINT="http://localhost:37265" calabash-ios console
> start_test_server_in_background

您可以查看您的 shell 中是否定义了 DEVICE_ENDPOINT:

$ echo $DEVICE_ENDPOINT