环境:
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.启动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并返回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但仍然无法连接。我尝试在其他模拟器上运行,我收到相同的连接超时错误。
答案 0 :(得分:1)
在start_test_server_in_background
中运行query()
之前,您有irb
吗?在葫芦可以与您的应用互动之前,必须进行相当复杂的附件流程。
答案 1 :(得分:1)
+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控制台,或者已在您的shell中导出DEVICE_ENDPOINT
。
尝试:
$ DEVICE_ENDPOINT="http://localhost:37265" calabash-ios console
> start_test_server_in_background
您可以查看您的shell中是否已定义DEVICE_ENDPOINT
:
$ echo $DEVICE_ENDPOINT