每次断开时间也不一致,有时候半小时,有时候一个半小时,有时候两个半小时,有小伙伴遇到过这种情况么?

环境信息:
  1. python: 3.7.3
  2. facebook-wda: 0.4.1
  3. com.facebook.wda.runner: 6.0
  4. xcode:10.3
  5. mac os:10.14.6
  6. 设备:iphone5s(12.4.1),iphone6p(12.1.4)
python 端报错日志

这里只能看出来是连接断了

E               urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

xcodebuild 日志

Session-WebDriverAgentRunner 日志路径:/Users/zhangsan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gepobbogdbbwbigexigktqefklzg/Logs/Test/Test-WebDriverAgentRunner-2019.09.23_17-57-30-+0800.xcresult/1_Test/Diagnostics/WebDriverAgentRunner-79E6171C-C803-446E-8972-168FD5BE3D85/WebDriverAgentRunner-EB35C1AF-7EBA-42B5-B47A-FF12D89E3E18/Session-WebDriverAgentRunner-2019-09-23_193014-DJYk0S.log

19:30:32.551 WebDriverAgentRunner-Runner[2386:71867] Process environment: {
    "CA_ASSERT_MAIN_THREAD_TRANSACTIONS" = 0;
    "CA_DEBUG_TRANSACTIONS" = 0;
    "CFFIXED_USER_HOME" = "/private/var/mobile/Containers/Data/Application/EE8303AA-404F-4CF0-B55F-5E141B9431BE";
    CLASSIC = 1;
    "DYLD_FRAMEWORK_PATH" = "/private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/Frameworks:";
    "DYLD_LIBRARY_PATH" = "/usr/lib/swift:/private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/Frameworks";
    HOME = "/private/var/mobile/Containers/Data/Application/EE8303AA-404F-4CF0-B55F-5E141B9431BE";
    LOGNAME = mobile;
    "MJPEG_SERVER_PORT" = "";
    "MTC_CRASH_ON_REPORT" = 1;
    NSUnbufferedIO = YES;
    "OS_ACTIVITY_DT_MODE" = YES;
    PATH = "/usr/bin:/bin:/usr/sbin:/sbin";
    SHELL = "/bin/sh";
    "SQLITE_ENABLE_THREAD_ASSERTIONS" = 1;
    TMPDIR = "/private/var/mobile/Containers/Data/Application/EE8303AA-404F-4CF0-B55F-5E141B9431BE/tmp/";
    "UPGRADE_TIMESTAMP" = "";
    USER = mobile;
    "USE_PORT" = "";
    "WDA_PRODUCT_BUNDLE_IDENTIFIER" = "";
    XCTestConfigurationFilePath = "/private/var/mobile/Containers/Data/Application/EE8303AA-404F-4CF0-B55F-5E141B9431BE/tmp/WebDriverAgentRunner-841173F8-F53E-4429-9D42-B0CBC344BFF5.xctestconfiguration";
    "XPC_FLAGS" = 0x0;
    "XPC_SERVICE_NAME" = "UIKitApplication:com.apple.test.WebDriverAgentRunner-Runner[0xd183][60]";
    "__CF_USER_TEXT_ENCODING" = "0x1F5:0:0";
}
19:30:32.552 WebDriverAgentRunner-Runner[2386:71867] App Sandbox active: YES
19:30:32.589 WebDriverAgentRunner-Runner[2386:71867] Creating future for 'Acquiring IDE transport' with timeout 60.00
19:30:32.712 WebDriverAgentRunner-Runner[2386:71867] Creating future for 'Exchange protocol versions with daemon' with timeout 15.00
19:30:32.732 WebDriverAgentRunner-Runner[2386:71867] <XCTWaiter: 0x280f5ce80, state: XCTWaiterStateSucceeded> entering wait loop for 15.00s with expectations: `Exchange protocol versions with daemon`
19:30:32.733 WebDriverAgentRunner-Runner[2386:71867] <XCTWaiter: 0x280f5ce80, state: XCTWaiterStateSucceeded> done waiting
19:30:32.733 WebDriverAgentRunner-Runner[2386:71867] Canceling watchdog for <XCTWaiter: 0x280f5ce80, state: XCTWaiterStateSucceeded>.
19:30:32.733 WebDriverAgentRunner-Runner[2386:71867] <XCTWaiter: 0x280f5ce80, state: XCTWaiterStateSucceeded> cleaning up `Exchange protocol versions with daemon`
19:30:32.734 WebDriverAgentRunner-Runner[2386:71867] Got daemon protocol version 26
19:30:32.735 WebDriverAgentRunner-Runner[2386:71867] Requesting IDE connection transport
19:30:32.736 WebDriverAgentRunner-Runner[2386:71867] <XCTWaiter: 0x280f5ca60, state: XCTWaiterStateInProgress> entering wait loop for 59.88s with expectations: `Acquiring IDE transport`
19:30:32.740 WebDriverAgentRunner-Runner[2386:71927] Creating transport with received transport data
19:30:32.741 WebDriverAgentRunner-Runner[2386:71927] <XCTWaiter: 0x280f5ca60, state: XCTWaiterStateSucceeded>: cancelWaiting
19:30:32.745 WebDriverAgentRunner-Runner[2386:71867] <XCTWaiter: 0x280f5ca60, state: XCTWaiterStateSucceeded> done waiting
19:30:32.745 WebDriverAgentRunner-Runner[2386:71867] Canceling watchdog for <XCTWaiter: 0x280f5ca60, state: XCTWaiterStateInProgress>.
19:30:32.745 WebDriverAgentRunner-Runner[2386:71867] <XCTWaiter: 0x280f5ca60, state: XCTWaiterStateSucceeded> cleaning up `Acquiring IDE transport`
19:30:32.745 WebDriverAgentRunner-Runner[2386:71867] Creating connection with transport <DTXFileDescriptorTransport: 0x28265e990>
19:30:32.747 WebDriverAgentRunner-Runner[2386:71867] Creating the proxy channel with connection <DTXConnection 0x283150000 : x1>
19:30:33.140 xcodebuild[57209:7764306] Starting test plan, clearing initialization timeout timer.
19:30:33.100 WebDriverAgentRunner-Runner[2386:71867] Initializing for UI testing.
19:30:33.113 WebDriverAgentRunner-Runner[2386:71867] Linked XCTAutomationSupport.framework from /var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/Frameworks/XCTAutomationSupport.framework/XCTAutomationSupport, built with Xcode 1020(10G1d), modified on 2019年9月23日 星期一 中国标准时间 17:59:11
XCTAutomationSupport.framework bundle version: 14490.71
19:30:33.117 WebDriverAgentRunner-Runner[2386:71867] Creating future for 'Loading Accessibility' with timeout 70.00
19:30:33.118 WebDriverAgentRunner-Runner[2386:71867] <XCTWaiter: 0x280f51920, state: XCTWaiterStateInProgress> entering wait loop for 70.00s with expectations: `Loading Accessibility`
19:30:33.124 WebDriverAgentRunner-Runner[2386:71927] <XCTWaiter: 0x280f51920, state: XCTWaiterStateSucceeded>: cancelWaiting
19:30:33.124 WebDriverAgentRunner-Runner[2386:71867] <XCTWaiter: 0x280f51920, state: XCTWaiterStateSucceeded> done waiting
19:30:33.125 WebDriverAgentRunner-Runner[2386:71867] Canceling watchdog for <XCTWaiter: 0x280f51920, state: XCTWaiterStateInProgress>.
19:30:33.125 WebDriverAgentRunner-Runner[2386:71867] <XCTWaiter: 0x280f51920, state: XCTWaiterStateSucceeded> cleaning up `Loading Accessibility`
19:30:33.126 WebDriverAgentRunner-Runner[2386:71867] Error from daemon in loading AX: Not authorized for performing UI testing actions.
19:30:33.126 WebDriverAgentRunner-Runner[2386:71867] Error capturing sample for process backboardd:
Error Domain=XCTDaemonErrorDomain Code=20 "Failed to spawn process for sample: 22 - Invalid argument" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 22 - Invalid argument}
19:30:33.126 WebDriverAgentRunner-Runner[2386:71867] Error capturing sample for process SpringBoard:
Error Domain=XCTDaemonErrorDomain Code=20 "Failed to spawn process for sample: 22 - Invalid argument" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 22 - Invalid argument}
19:30:33.127 WebDriverAgentRunner-Runner[2386:71867] Failed to load accessibility.
19:30:33.127 WebDriverAgentRunner-Runner[2386:71867] Failed to initialize for UI testing: Error Domain=XCTDaemonErrorDomain Code=41 "Not authorized for performing UI testing actions." UserInfo={samples={
    SpringBoard = "Error Domain=XCTDaemonErrorDomain Code=20 \"Failed to spawn process for sample: 22 - Invalid argument\" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 22 - Invalid argument}";
    backboardd = "Error Domain=XCTDaemonErrorDomain Code=20 \"Failed to spawn process for sample: 22 - Invalid argument\" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 22 - Invalid argument}";
}, NSLocalizedDescription=Not authorized for performing UI testing actions.}
19:30:33.173 xcodebuild[57209:7764306] Initialization failure for UI testing: Not authorized for performing UI testing actions.
19:30:33.174 xcodebuild[57209:7764306] Test operation failure: The test runner failed to initialize for UI testing
19:30:33.174 xcodebuild[57209:7764306] _finishWithError:Error Domain=IDETestOperationsObserverErrorDomain Code=13 "The test runner failed to initialize for UI testing" UserInfo={NSLocalizedDescription=The test runner failed to initialize for UI testing, NSUnderlyingError=0x7fbbf3b57c10 {Error Domain=XCTDaemonErrorDomain Code=41 "Not authorized for performing UI testing actions." UserInfo={samples={
    SpringBoard = "Error Domain=XCTDaemonErrorDomain Code=20 \"Failed to spawn process for sample: 22 - Invalid argument\" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 22 - Invalid argument}";
    backboardd = "Error Domain=XCTDaemonErrorDomain Code=20 \"Failed to spawn process for sample: 22 - Invalid argument\" UserInfo={NSLocalizedDescription=Failed to spawn process for sample: 22 - Invalid argument}";
}, NSLocalizedDescription=Not authorized for performing UI testing actions.}}}

StandardOutputAndStandardError.txt 日志路径:/Users/zhangsan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gepobbogdbbwbigexigktqefklzg/Logs/Test/Test-WebDriverAgentRunner-2019.09.23_17-57-30-+0800.xcresult/1_Test/Diagnostics/WebDriverAgentRunner-79E6171C-C803-446E-8972-168FD5BE3D85/WebDriverAgentRunner-EB35C1AF-7EBA-42B5-B47A-FF12D89E3E18/StandardOutputAndStandardError.txt

== 0 OR frame == 0 OR value == 0 OR title == 0 OR label == 0 OR elementType == 0 OR enabled == 0 OR placeholderValue == 0)'
    t =  4290.27s     Find: Identity Binding
    t =  4290.28s Snapshot accessibility hierarchy for app with pid 1700
    t =  4290.28s Find: Descendants matching type Table
    t =  4290.29s Find: Children matching type Cell
    t =  4290.30s Find: Identity Binding
    t =  4290.30s Find: Children matching type StaticText
    t =  4290.30s Find: Elements matching predicate 'wdName == "This is 007.jpg Email20190923191032" AND (1 == 1 OR identifier == 0 OR frame == 0 OR value == 0 OR title == 0 OR label == 0 OR elementType == 0 OR enabled == 0 OR placeholderValue == 0)'
    t =  4290.31s Find: Identity Binding
    t =  4290.57s Get all elements bound by accessibility element for: Children matching type Cell
    t =  4290.58s     Snapshot accessibility hierarchy for app with pid 1700
    t =  4292.13s     Find: Descendants matching type Table
    t =  4292.13s     Find: Children matching type Cell
    t =  4292.72s Get all elements bound by accessibility element for: Children matching type StaticText
    t =  4292.73s     Snapshot accessibility hierarchy for app with pid 1700
    t =  4292.85s     Find: Descendants matching type Table
    t =  4292.86s     Find: Children matching type Cell
    t =  4292.86s     Find: Identity Binding
    t =  4292.92s Get all elements bound by accessibility element for: Children matching type Cell
    t =  4292.92s     Snapshot accessibility hierarchy for app with pid 1700
    t =  4293.04s     Find: Descendants matching type Table
    t =  4293.05s     Find: Children matching type Cell
    t =  4293.28s Get all elements bound by accessibility element for: Children matching type StaticText
    t =  4293.28s     Snapshot accessibility hierarchy for app with pid 1700
    t =  4293.40s     Find: Descendants matching type Table
    t =  4293.41s     Find: Children matching type Cell
    t =  4293.41s     Find: Identity Binding
    t =  4293.42s     Find: Children matching type StaticText
    t =  4293.49s Checking existence of `"This is 007.jpg Email20190923191032" StaticText`
    t =  4293.50s     Snapshot accessibility hierarchy for app with pid 1700
    t =  4293.62s     Find: Descendants matching type Table
    t =  4293.63s     Find: Children matching type Cell
    t =  4293.63s     Find: Identity Binding
    t =  4293.64s     Find: Children matching type StaticText
    t =  4293.64s     Find: Identity Binding
    t =  4293.65s Snapshot accessibility hierarchy for app with pid 1700
2019-09-23 19:30:31.749442+0800 WebDriverAgentRunner-Runner[2386:71867] Running tests...
objc[2386]: Class GCDAsyncSocketPreBuffer is implemented in both /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x102778578) and /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x1026e1358). One of the two will be used. Which one is undefined.
objc[2386]: Class GCDAsyncReadPacket is implemented in both /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x1027785c8) and /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x1026e13a8). One of the two will be used. Which one is undefined.
objc[2386]: Class GCDAsyncWritePacket is implemented in both /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x102778618) and /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x1026e13f8). One of the two will be used. Which one is undefined.
objc[2386]: Class GCDAsyncSpecialPacket is implemented in both /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x102778668) and /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x1026e1448). One of the two will be used. Which one is undefined.
objc[2386]: Class GCDAsyncSocket is implemented in both /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/CocoaAsyncSocket.framework/CocoaAsyncSocket (0x1027786b8) and /private/var/containers/Bundle/Application/A18F515B-773A-497F-89F7-29918BC1B713/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer (0x1026e1498). One of the two will be used. Which one is undefined.


*** If you believe this error represents a bug, please attach the result bundle at /Users/zhangsan/Library/Developer/Xcode/DerivedData/WebDriverAgent-gepobbogdbbwbigexigktqefklzg/Logs/Test/Test-WebDriverAgentRunner-2019.09.23_17-57-30-+0800.xcresult


↙↙↙阅读原文可查看相关链接,并与作者交流