XCUITest,关闭WebDriverAgent,xcodebuild以代码'null'退出

时间:2016-11-15 14:52:47

标签: ios appium-ios

我在iOS平台上遇到xcuittest的新问题。 WebDriverAgent一直重新启动,我无法运行测试。你知道如何解决这个问题吗?

这是日志。经过几次尝试,测试成功执行。

[debug] [XCUITest] Log file for xcodebuild test:     /Users/grru/Library/Developer/Xcode/DerivedData/WebDriverAgent-    brdadhpuduowllgivnnvuygpwhzy/Logs/Test/5766A03B-3333-45AC-970E-    C70A603CA4AC/Session-WebDriverAgentRunner-2016-11-15_150602-Dhgrly.log
[Xcode] 2016-11-15 15:06:02.318 xcodebuild[713:28168]      IDETestOperationsObserverDebug: Writing diagnostic log for test session     to:
/Users/grru/Library/Developer/Xcode/DerivedData/WebDriverAgent-    brdadhpuduowllgivnnvuygpwhzy/Logs/Test/5766A03B-3333-45AC-970E-    C70A603CA4AC/Session-WebDriverAgentRunner-2016-11-15_150602-Dhgrly.log

[Xcode] ▸ Building WebDriverAgent/WebDriverAgentLib [Debug]
▸ Check Dependencies

[Xcode] ▸ Running script 'Generate modules'

[Xcode] ▸ Compiling FBScreenshotCommands.m

[Xcode] ▸ Compiling FBWebServer.m

[Xcode] ▸ Compiling FBErrorBuilder.m

[Xcode] ▸ Compiling FBHTTPOverUSBServer.m

[Xcode] ▸ Compiling FBXPathCreator.m

[Xcode] ▸ Compiling XCUIApplication+FBHelpers.m

[Xcode] ▸ Compiling FBKeyboard.m

[Xcode] ▸ Compiling FBApplicationProcessProxy.m

[Xcode] ▸ Compiling FBFailureProofTestCase.m
▸ Compiling XCUIElement+FBIsVisible.m

[Xcode] ▸ Compiling XCUIElement+FBFind.m
▸ Compiling FBResponsePayload.m

[Xcode] ▸ Compiling FBRoute.m

[Xcode] ▸ Compiling FBRunLoopSpinner.m

[Xcode] ▸ Compiling XCUIDevice+FBRotation.m

[Xcode] ▸ Compiling FBRouteRequest.m

[Xcode] ▸ Compiling FBResponseJSONPayload.m

[Xcode] ▸ Compiling FBXCTestCaseImplementationFailureHoldingProxy.m

[Xcode] ▸ Compiling XCUIDevice+FBHealthCheck.m

[Xcode] ▸ Compiling FBSpringboardApplication.m

[Xcode] ▸ Compiling FBResponseFilePayload.m

[Xcode] ▸ Compiling XCUIElement+FBWebDriverAttributes.m

[Xcode] ▸ Compiling FBTouchIDCommands.m

[Xcode] ▸ Compiling FBElement.m
▸ Compiling FBDebugCommands.m

[Xcode] ▸ Compiling FBUnknownCommands.m

[Xcode] ▸ Compiling FBOrientationCommands.m

[Xcode] ▸ Compiling FBRuntimeUtils.m

[Xcode] ▸ Compiling XCUIElement+FBUtilities.m

[Xcode] ▸ Compiling FBLogger.m

[Xcode] ▸ Compiling FBCustomCommands.m

[Xcode] ▸ Compiling XCUIDevice+FBHelpers.m
▸ Compiling XCTestPrivateSymbols.m

[Xcode] ▸ Compiling XCUIElement+FBTyping.m

[Xcode] ▸ Compiling XCUIElement+FBAccessibility.m

[Xcode] ▸ Compiling FBSession.m

[Xcode] ▸ Compiling FBFindElementCommands.m

[Xcode] ▸ Compiling FBDebugLogDelegateDecorator.m

[Xcode] ▸ Compiling FBAlertViewCommands.m

[Xcode] ▸ Compiling FBSessionCommands.m

[Xcode] ▸ Compiling XCUIElement+FBScrolling.m

[Xcode] ▸ Compiling FBInspectorCommands.m

[Xcode] ▸ Compiling FBConfiguration.m

[Xcode] ▸ Compiling FBElementCache.m

[Xcode] ▸ Compiling FBAlert.m

[Xcode] ▸ Compiling FBElementCommands.m

[Xcode] ▸ Compiling FBExceptionHandler.m

[Xcode] ▸ Compiling XCElementSnapshot+FBHelpers.m

[Xcode] ▸ Compiling FBElementTypeTransformer.m

[Xcode] ▸ Compiling FBApplication.m

[Xcode] ▸ Compiling XCUIElement+FBTap.m

[Xcode] ▸ Compiling FBMathUtils.m

[Xcode] ▸ Linking WebDriverAgentLib

[Xcode] ▸ Touching WebDriverAgentLib.framework

[Xcode] ▸ Signing     /Users/grru/Library/Developer/Xcode/DerivedData/WebDriverAgent-    brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-    iphoneos/WebDriverAgentLib.framework

[Xcode] ▸ Building WebDriverAgent/WebDriverAgentRunner [Debug]
▸ Check Dependencies

[Xcode] ▸ Compiling UITestingUITests.m

[Xcode] ▸ Linking WebDriverAgentRunner

[Xcode] ▸ Copying     /Users/grru/Library/Developer/Xcode/DerivedData/WebDriverAgent-    brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-    iphoneos/WebDriverAgentLib.framework

[Xcode] ▸ Signing     /Users/grru/Library/Developer/Xcode/DerivedData/WebDriverAgent-    brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-    iphoneos/WebDriverAgentRunner-    Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentL    ib.framework

[Xcode] ▸ Touching WebDriverAgentRunner.xctest

[Xcode] ▸ Signing     /Users/grru/Library/Developer/Xcode/DerivedData/WebDriverAgent-    brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-    iphoneos/WebDriverAgentRunner-    Runner.app/PlugIns/WebDriverAgentRunner.xctest

[Xcode] ▸ Signing     /Users/grru/Library/Developer/Xcode/DerivedData/WebDriverAgent-    brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-    iphoneos/WebDriverAgentRunner-Runner.app

[Xcode] writeDictToFile:1278 ==== Successfully wrote Manifest cache     to     /var/folders/jp/fj2vnzd91mdfr3tm_0d92sgw0000gq/C/com.apple.DeveloperTools    /All/Xcode/EmbeddedAppDeltas/7fed6ae99da305d7cfbf5f9b71df6874/32731c832b8    0d17d6a29f1dafbc06faf9e4978a5/ManifestCache.plist

[debug] [WebDriverAgent] Device: Nov 15 15:06:19 iPhone5cGreen     XCTRunner[346] <Notice>: Running tests...
[debug] [WebDriverAgent] Device: Nov 15 15:06:21 iPhone5cGreen     XCTRunner[346] <Notice>: Continuing to run tests in the background with     task ID 1
[XCUITest] Detected that WebDriverAgent is running at url     'http://(null):8100'
[XCUITest] WebDriverAgent started at url 'http://(null):8100'
[debug] [XCUITest] Starting iproxy to forward traffic from local port     8100 to device port 8100 over USB
[JSONWP Proxy] Proxying [POST /session] to [POST     http://localhost:8100/session] with body: {"desiredCapabilities":    {"bundleId":"com.t-mobile.TMOAccess","arguments":[],"environment":    {},"shouldWaitForQuiescence":true}}
[JSONWP Proxy] Got response with status 200: {"sessionId":"99FCF2D3-    9CF3-471B-845E-A9543598A115","value":{"sessionId":"99FCF2D3-9CF3-471B-    845E-A9543598A115","capabilities":{"browserName":"     ","device":"iphone","CFBundleIdentifier":"local.pid.47","sdkVersion":"10.    0.1"}},"status":0}
[Appium] New XCUITestDriver session created successfully, session     e67995a2-d883-48e5-8f8b-a0b45625467a added to master session list
[MJSONWP] Responding to client with driver.createSession() result:     {"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"    ","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"take    sScreenshot":true,"networkConnectionEnabled":false,"deviceName":"iPhone5c    Green (10.0.1)","udid":"3273...
[HTTP] <-- POST /wd/hub/session 200 109075 ms - 559 
[HTTP] --> DELETE /wd/hub/session/e67995a2-d883-48e5-8f8b-    a0b45625467a {}
[MJSONWP] Calling AppiumDriver.deleteSession() with args: ["e67995a2-    d883-48e5-8f8b-a0b45625467a"]
[JSONWP Proxy] Proxying [DELETE /session/e67995a2-d883-48e5-8f8b-    a0b45625467a] to [DELETE http://localhost:8100/session/99FCF2D3-9CF3-    471B-845E-A9543598A115] with no body
[JSONWP Proxy] Got response with status 200: "{\n  \"sessionId\" :     \"B26C2179-8F9C-400B-B0A2-C4C520C8A707\",\n  \"value\" : {\n\n  },\n      \"status\" : 0\n}"
[XCUITest] Shutting down WebDriverAgent
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[XCUITest] iproxy exited 
[XCUITest] System log exited with code '0'
[debug] [XCUITest] WebDriverAgent process did not end in a timely     fashion. Sending SIGHUP signal...
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
(node:674) UnhandledPromiseRejectionWarning: Unhandled promise     rejection (rejection id: 4): Error: Can't stop process; it's not     currently running
[Appium] Removing session e67995a2-d883-48e5-8f8b-a0b45625467a from     our master session list
[debug] [MJSONWP] Received response: null

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。在我的情况下,我发现目标设备(iPhone / iPad)和Mac需要在同一个网络上。因此,请检查您的设备和Mac是否在同一网络上。 谢谢, 米希尔