Appium window 上运行 tidevice+appium,关于 webDriverAgentUrl 问题,麻烦大佬帮忙看看

Forkey · 2021年06月23日 · 最后由 xuanhui 回复于 2023年03月13日 · 5237 次阅读

window 环境

  • Appium server V1.21.0
  • tideviceV0.4.8
  • iOS 设备 iPhone6 Plus(12.5.2)已安装上 wda

相关信息

  1. tidevice 启动 webdriverAgent 成功

  1. localhost:8100/status 正常

python 脚本 desired_capabilities

desired_capabilities = {
    "udid": "4335249214ddbe63092a4965347f078f8833179e",
    "automationName": "XCUITest",
    "deviceName": "iphone6s Plus",
    "platformName": "iOS",
    "platforVersion": "12.5.2",
    "bundleId": "xxxxxxxx",
    "webDriverAgentUrl": "http://localhost:8100/",
    "usePrebuiltWDA": "false",
    "useNewWDA": "false",
    "useXctestrunFile": "false",
    "skipLogCapture": "true",
    "noReset": "true",
    "xcodeOrgId": "xxxxxx",
    "xcodeSigningId": "iPhone Developer"
}

appium 日志

[Appium] Welcome to Appium v1.21.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [HTTP] Request idempotency key: 49c53516-13b5-4134-9709-7022f81f1d4e
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"firstMatch":[{"appium:webDriverAgentUrl":"http://localhost:8100/","appium:udid":"4335249214ddbe63092a4965347f078f8833179e","appium:automationName":"XCUITest","appium:deviceName":"iphone6s Plus","platformName":"iOS","appium:platforVersion":"12.5.2","appium:bundleId":"xxxxxxxxx","appium:usePrebuiltWDA":"false","appium:useNewWDA":"false","appium:useXctestrunFile":"false","appium:skipLogCapture":"true","appium:noReset":"true","appium:xcodeOrgId":"xxxxxxxx","appium:xcodeSigningId":"iPhone Developer"}]},"desiredCapabilities":{"webDriverAgentUrl":"http://localhost:8100/","udid":"4335249214ddbe63092a4965347f078f8833179e","automationName":"XCUITest","deviceName":"iphone6s Plus","platformName":"iOS","platforVersion":"12.5.2","bundleId":"xxxxxxxxx","usePrebuiltWDA":"false","useNewWDA":"false","useXctestrunFile":"false","skipLogCapture":"true","noReset":"true","xcodeOrgId":"xxxxxxxx","xcodeSigningId":"iPhone Developer"}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"webDriverAgentUrl":"http://localhost:8100/","udid":"4335249214ddbe63092a4965347f078f8833179e","automationName":"XCUITest","deviceName":"iphone6s Plus","platformName":"iOS","platforVersion":"12.5.2","bundleId":"xxxxxxxx","usePrebuiltWDA":"false","useNewWDA":"false","useXctestrunFile":"false","skipLogCapture":"true","noReset":"true","xcodeOrgId":"xxxxxxxx","xcodeSigningId":"iPhone Developer"},null,{"firstMatch":[{"appium:webDriverAgentUrl":"http://localhost:8100/","appium:udid":"4335249214ddbe63092a4965347f078f8833179e","appium:automationName":"XCUITest","appium:deviceName":"iphone6s Plus","platformName":"iOS","appium:platforVersion":"12.5.2","appium:bundleId":"xxxxxxxx","appium:usePrebuiltWDA":"false","appium:useNewWDA":"false","appium:useXctestrunFile":"false","appium:skipLogCapture":"true","appium:noReset":"true","appium:xcodeOrgId":"xxxxxxxx","appium:xcodeSigningId":"iPhone Developer"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1624408869354 (08:41:09 GMT+0800 (中国标准时间))
[Appium] Appium v1.21.0 creating new XCUITestDriver (v3.43.0) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "iOS",
[debug] [BaseDriver]     "appium:webDriverAgentUrl": "http://localhost:8100/",
[debug] [BaseDriver]     "appium:udid": "4335249214ddbe63092a4965347f078f8833179e",
[debug] [BaseDriver]     "appium:automationName": "XCUITest",
[debug] [BaseDriver]     "appium:deviceName": "iphone6s Plus",
[debug] [BaseDriver]     "appium:platforVersion": "12.5.2",
[debug] [BaseDriver]     "appium:bundleId": "xxxxxxxx",
[debug] [BaseDriver]     "appium:usePrebuiltWDA": "false",
[debug] [BaseDriver]     "appium:useNewWDA": "false",
[debug] [BaseDriver]     "appium:useXctestrunFile": "false",
[debug] [BaseDriver]     "appium:skipLogCapture": "true",
[debug] [BaseDriver]     "appium:noReset": "true",
[debug] [BaseDriver]     "appium:xcodeOrgId": "xxxxxxxx",
[debug] [BaseDriver]     "appium:xcodeSigningId": "iPhone Developer"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'usePrebuiltWDA' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'useNewWDA' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'useXctestrunFile' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'skipLogCapture' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   platforVersion
[XCUITest] 'platformVersion' capability ('undefined') is not a valid version number. Consider fixing it or be ready to experience an inconsistent driver behavior.
[BaseDriver] Session created with session id: 66ddce91-3e04-46e8-a2b8-c539a2ae5032
[debug] [XCUITest] Current user: 'xxxxxx\xxxxx'
[debug] [XCUITest] Available devices: 4335249214ddbe63092a4965347f078f8833179e
[debug] [XCUITest] Creating iDevice object with udid '4335249214ddbe63092a4965347f078f8833179e'
[XCUITest] Determining device to run tests on: udid: '4335249214ddbe63092a4965347f078f8833179e', real device: true
[XCUITest] No platformVersion specified. Using device version: '12.5.2'
[XCUITest] Normalized platformVersion capability value '12.5.2' to '12.5'
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1624408871184 (08:41:11 GMT+0800 (中国标准时间))
[debug] [BaseDriver] Event 'appConfigured' logged at 1624408871184 (08:41:11 GMT+0800 (中国标准时间))
[debug] [BaseDriver] Event 'resetStarted' logged at 1624408871186 (08:41:11 GMT+0800 (中国标准时间))
[debug] [XCUITest] Reset: fullReset not set. Leaving as is
[debug] [BaseDriver] Event 'resetComplete' logged at 1624408871187 (08:41:11 GMT+0800 (中国标准时间))
[WebDriverAgent] Using WDA path: 'C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-webdriveragent'
[WebDriverAgent] Using WDA agent: 'C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-webdriveragent\WebDriverAgent.xcodeproj'
[XCUITest] 'skipLogCapture' is set. Skipping starting logs such as crash, system, safari console and safari network.
[XCUITest] Setting up real device
[WebDriverAgent] Cannot retrieve WDA build settings. Original error: spawn xcodebuild ENOENT
[DevCon Factory] Requesting connection for device 4335249214ddbe63092a4965347f078f8833179e on local port 8100
[debug] [DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for 4335249214ddbe63092a4965347f078f8833179e:8100
[debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[debug] [XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval
[debug] [XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1624408871430 (08:41:11 GMT+0800 (中国标准时间))
[WebDriverAgent] Using provided WebdriverAgent at 'http://localhost:8100/'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [WD Proxy] Got response with status 200: {"value":{"state":"success","os":{"name":"iOS","version":"12.5.2"},"ios":{"simulatorVersion":"12.5.2","ip":"192.168.1.55"},"build":{"time":"Jun  7 2021 09:31:00"}},"sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":0}
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408871459 (08:41:11 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408872513 (08:41:12 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408873529 (08:41:13 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408874547 (08:41:14 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408875562 (08:41:15 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408876575 (08:41:16 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408877593 (08:41:17 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408878606 (08:41:18 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408879620 (08:41:19 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408880633 (08:41:20 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408881676 (08:41:21 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408882698 (08:41:22 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408883718 (08:41:23 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408884738 (08:41:24 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624408885753 (08:41:25 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"588743A3-D11A-4EEF-B278-E8E081AF6C2F","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [XCUITest] UnknownError: An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided
[debug] [XCUITest]     at errorFromMJSONWPStatusCode (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:767:10)
[debug] [XCUITest]     at ProxyRequestError.getActualError (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:661:14)
[debug] [XCUITest]     at JWProxy.command (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:272:19)
[debug] [XCUITest]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[debug] [XCUITest]     at XCUITestDriver.proxyCommand (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\commands\proxy-helper.js:96:12)
[debug] [XCUITest]     at XCUITestDriver.startWdaSession (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:968:5)
[debug] [XCUITest]     at C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:592:15
[debug] [XCUITest]     at wrapped (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:60:13)
[debug] [XCUITest]     at retry (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:43:13)
[debug] [XCUITest]     at retryInterval (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:70:10)
[debug] [XCUITest]     at C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:587:11
[debug] [XCUITest]     at wrapped (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:60:13)
[debug] [XCUITest]     at retry (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:43:13)
[debug] [XCUITest]     at retryInterval (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:70:10)
[debug] [XCUITest]     at C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:559:7
[debug] [XCUITest] Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[debug] [XCUITest] Not quitting/uninstalling WebDriverAgent since webDriverAgentUrl capability is provided
[XCUITest] {}
[DevCon Factory] Releasing connections for 4335249214ddbe63092a4965347f078f8833179e device on any port number
[DevCon Factory] Found cached connections to release: ["4335249214ddbe63092a4965347f078f8833179e:8100"]
[debug] [DevCon Factory] Cached connections count: 0
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1624408885791 (08:41:25 GMT+0800 (中国标准时间))
[debug] [W3C] Encountered internal error running command: Error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[debug] [W3C]     at quitAndUninstall (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:539:17)
[debug] [W3C]     at C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:610:17
[debug] [W3C]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[debug] [W3C]     at wrapped (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:60:13)
[debug] [W3C]     at retry (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:43:13)
[debug] [W3C]     at retryInterval (C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:70:10)
[debug] [W3C]     at C:\Users\xxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:559:7
[HTTP] <-- POST /wd/hub/session 500 16455 ms - 1437

问题:

  1. 在脚本中已经增加了 webDriverAgentUrl,但是从 appium 日志来看,还是走了调取了本地的 appium-webdriveragent

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 11 条回复 时间 点赞

appium 日志里,有个地方要留意下

[BaseDriver] Capability 'usePrebuiltWDA' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'useNewWDA' changed from string to boolean. This may cause unexpected behavior

这种转换不知道结果是布尔值的 true 还是 false

"webDriverAgentUrl": "http://localhost:8100/",
"usePrebuiltWDA": "false",
"useNewWDA": "false",

建议第二、第三个改为用布尔值的 false,不要用字符串的 false 。

我们内部用,只需要配置 webDriverAgentUrluseNewWDA(值为 false ),就可以用 atx server 云真机上提供的 wda 来执行自动化了。

陈恒捷 回复

感谢,我试试

Forkey 回复

@chenhengjie123 改为你说的那样子还是不行, 报的是同样错误。

desired_capabilities = {
    "udid": "4335249214ddbe63092a4965347f078f8833179e",
    "automationName": "XCUITest",
    "deviceName": "iphone6s Plus",
    "platformName": "iOS",
    "platformVersion": "12.5.2",
    "bundleId": "xxxxxx",
    "webDriverAgentUrl": "http://localhost:8100/",
    "usePrebuiltWDA": False,
    "useNewWDA": False,
    "useXctestrunFile": False,
    "skipLogCapture": True,
    "noReset": True,
    "xcodeOrgId": "xxxxxx",
    "xcodeSigningId": "iPhone Developer"
}

如果用 facebook-wda 直接调用是没问题的。

日志发一下?

然后,也试试去掉 "usePrebuiltWDA": False, 试试?

分享下我们实际用的:

"desiredCapabilities": {
    "noReset": true,
    "xcodeOrgId": "xxx",
    "bundleId": "xxx",
    "skipLogCapture": true,
    "deviceName": "iPhone6s",
    "wdaLocalPort": 25000,
    "webDriverAgentUrl": "http://192.168.25.12:20474",
    "waitForQuiescence": false,
    "newCommandTimeout": 43200,
    "platformVersion": "14.5.1",
    "automationName": "XCUITest",
    "useNewWDA": false,
    "wdaStartupRetries": 0,
    "platformName": "iOS",
    "udid": "xxx",
    "wdaConnectionTimeout": 1800000,
    "autoAcceptAlerts": true
}
陈恒捷 回复
配置
desired_capabilities = {
            "noReset": True,
            "xcodeOrgId": "xxxxxxx",
            "bundleId": "xxxxxxx",
            "skipLogCapture": True,
            "deviceName": "iphone6s Plus",
            "wdaLocalPort": 25000,
            "webDriverAgentUrl": "http://localhost:8100",
            "waitForQuiescence": False,
            "newCommandTimeout": 43200,
            "platformVersion": "12.5",
            "automationName": "XCUITest",
            "useNewWDA": False,
            "wdaStartupRetries": 0,
            "platformName": "iOS",
            "udid": "xxxxxxx",
            "wdaConnectionTimeout": 1800000,
            "autoAcceptAlerts": True
        }
appium 日志:
[Appium] Welcome to Appium v1.21.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [HTTP] Request idempotency key: 94c0b34b-ff7f-4575-a3ba-ccba8a889a91
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"firstMatch":[{"appium:noReset":true,"appium:xcodeOrgId":"xxxxxx","appium:bundleId":"xxxxxx","appium:skipLogCapture":true,"appium:deviceName":"iphone6s Plus","appium:wdaLocalPort":25000,"appium:webDriverAgentUrl":"http://localhost:8100","appium:waitForQuiescence":false,"appium:newCommandTimeout":43200,"appium:platformVersion":"12.5","appium:automationName":"XCUITest","appium:useNewWDA":false,"appium:wdaStartupRetries":0,"platformName":"iOS","appium:udid":"4335249214ddbe63092a4965347f078f8833179e","appium:wdaConnectionTimeout":1800000,"appium:autoAcceptAlerts":true}]},"desiredCapabilities":{"noReset":true,"xcodeOrgId":"xxxxxx","bundleId":"xxxxxx","skipLogCapture":true,"deviceName":"iphone6s Plus","wdaLocalPort":25000,"webDriverAgentUrl":"http://localhost:8100","waitForQuiescence":false,"newCommandTimeout":43200,"platformVersion":"12.5","automationName":"XCUITest","useNewWDA":false,"wdaStartupRetries":0,"platformName":"iOS","udid":"4335249214ddbe...
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"noReset":true,"xcodeOrgId":"xxxxxx","bundleId":"xxxxxx","skipLogCapture":true,"deviceName":"iphone6s Plus","wdaLocalPort":25000,"webDriverAgentUrl":"http://localhost:8100","waitForQuiescence":false,"newCommandTimeout":43200,"platformVersion":"12.5","automationName":"XCUITest","useNewWDA":false,"wdaStartupRetries":0,"platformName":"iOS","udid":"4335249214ddbe63092a4965347f078f8833179e","wdaConnectionTimeout":1800000,"autoAcceptAlerts":true},null,{"firstMatch":[{"appium:noReset":true,"appium:xcodeOrgId":"xxxxxx","appium:bundleId":"xxxxxx","appium:skipLogCapture":true,"appium:deviceName":"iphone6s Plus","appium:wdaLocalPort":25000,"appium:webDriverAgentUrl":"http://localhost:8100","appium:waitForQuiescence":false,"appium:newCommandTimeout":43200,"appium:platformVersion":"12.5","appium:automationName":"XCUITest","appium:useNewWDA":false,"appium:wdaStartupRetries":0,"platformName":"iOS","appium:udid":"4335249214ddbe63092a4965347f078f8833179e","appium:wdaConnectio...
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1624443626123 (18:20:26 GMT+0800 (中国标准时间))
[Appium] Appium v1.21.0 creating new XCUITestDriver (v3.43.0) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "iOS",
[debug] [BaseDriver]     "appium:noReset": true,
[debug] [BaseDriver]     "appium:xcodeOrgId": "xxxxxx",
[debug] [BaseDriver]     "appium:bundleId": "xxxxxx",
[debug] [BaseDriver]     "appium:skipLogCapture": true,
[debug] [BaseDriver]     "appium:deviceName": "iphone6s Plus",
[debug] [BaseDriver]     "appium:wdaLocalPort": 25000,
[debug] [BaseDriver]     "appium:webDriverAgentUrl": "http://localhost:8100",
[debug] [BaseDriver]     "appium:waitForQuiescence": false,
[debug] [BaseDriver]     "appium:newCommandTimeout": 43200,
[debug] [BaseDriver]     "appium:platformVersion": "12.5",
[debug] [BaseDriver]     "appium:automationName": "XCUITest",
[debug] [BaseDriver]     "appium:useNewWDA": false,
[debug] [BaseDriver]     "appium:wdaStartupRetries": 0,
[debug] [BaseDriver]     "appium:udid": "4335249214ddbe63092a4965347f078f8833179e",
[debug] [BaseDriver]     "appium:wdaConnectionTimeout": 1800000,
[debug] [BaseDriver]     "appium:autoAcceptAlerts": true
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: 8e832c96-7bc2-40e2-be6e-8251511b004b
[debug] [XCUITest] Current user: 'xxxxxx\xxxxxx'
[debug] [XCUITest] Available devices: 4335249214ddbe63092a4965347f078f8833179e
[debug] [XCUITest] Creating iDevice object with udid '4335249214ddbe63092a4965347f078f8833179e'
[XCUITest] Determining device to run tests on: udid: '4335249214ddbe63092a4965347f078f8833179e', real device: true
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1624443628129 (18:20:28 GMT+0800 (中国标准时间))
[debug] [BaseDriver] Event 'appConfigured' logged at 1624443628130 (18:20:28 GMT+0800 (中国标准时间))
[debug] [BaseDriver] Event 'resetStarted' logged at 1624443628130 (18:20:28 GMT+0800 (中国标准时间))
[debug] [XCUITest] Reset: fullReset not set. Leaving as is
[debug] [BaseDriver] Event 'resetComplete' logged at 1624443628131 (18:20:28 GMT+0800 (中国标准时间))
[WebDriverAgent] Using WDA path: 'C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-webdriveragent'
[WebDriverAgent] Using WDA agent: 'C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-webdriveragent\WebDriverAgent.xcodeproj'
[XCUITest] 'skipLogCapture' is set. Skipping starting logs such as crash, system, safari console and safari network.
[XCUITest] Setting up real device
[WebDriverAgent] Cannot retrieve WDA build settings. Original error: spawn xcodebuild ENOENT
[DevCon Factory] Requesting connection for device 4335249214ddbe63092a4965347f078f8833179e on local port 8100
[debug] [DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for 4335249214ddbe63092a4965347f078f8833179e:8100
[debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[debug] [XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1624443628377 (18:20:28 GMT+0800 (中国标准时间))
[WebDriverAgent] Using provided WebdriverAgent at 'http://localhost:8100'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [WD Proxy] Got response with status 200: {"value":{"state":"success","os":{"name":"iOS","version":"12.5.2"},"ios":{"simulatorVersion":"12.5.2","ip":"192.168.1.55"},"build":{"time":"Jun  7 2021 09:31:00"}},"sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":0}
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443628425 (18:20:28 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443629496 (18:20:29 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443630536 (18:20:30 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443631567 (18:20:31 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443632598 (18:20:32 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443633627 (18:20:33 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443634655 (18:20:34 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443635683 (18:20:35 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443636709 (18:20:36 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443637747 (18:20:37 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443638788 (18:20:38 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443639835 (18:20:39 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443640872 (18:20:40 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443657103 (18:20:57 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1624443658130 (18:20:58 GMT+0800 (中国标准时间))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxxxxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"value":"'bundleId' desired capability not provided","sessionId":"A264BFB8-9EA0-416E-8E13-AC4F08BF37C2","status":13}
[WD Proxy] Determined the downstream protocol as 'MJSONWP'
[debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided). Retrying...
[debug] [XCUITest] UnknownError: An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided
[debug] [XCUITest]     at errorFromMJSONWPStatusCode (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:767:10)
[debug] [XCUITest]     at ProxyRequestError.getActualError (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:661:14)
[debug] [XCUITest]     at JWProxy.command (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:272:19)
[debug] [XCUITest]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[debug] [XCUITest]     at XCUITestDriver.proxyCommand (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\commands\proxy-helper.js:96:12)
[debug] [XCUITest]     at XCUITestDriver.startWdaSession (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:968:5)
[debug] [XCUITest]     at C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:592:15
[debug] [XCUITest]     at wrapped (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:60:13)
[debug] [XCUITest]     at retry (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:43:13)
[debug] [XCUITest]     at retryInterval (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:70:10)
[debug] [XCUITest]     at C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:587:11
[debug] [XCUITest]     at wrapped (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:60:13)
[debug] [XCUITest]     at retry (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:43:13)
[debug] [XCUITest]     at retryInterval (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:70:10)
[debug] [XCUITest]     at C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:559:7
[debug] [XCUITest] Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[debug] [XCUITest] Not quitting/uninstalling WebDriverAgent since webDriverAgentUrl capability is provided
[XCUITest] {}
[DevCon Factory] Releasing connections for 4335249214ddbe63092a4965347f078f8833179e device on any port number
[DevCon Factory] Found cached connections to release: ["4335249214ddbe63092a4965347f078f8833179e:8100"]
[debug] [DevCon Factory] Cached connections count: 0
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1624443658170 (18:20:58 GMT+0800 (中国标准时间))
[debug] [W3C] Encountered internal error running command: Error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: 'bundleId' desired capability not provided Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[debug] [W3C]     at quitAndUninstall (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:539:17)
[debug] [W3C]     at C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:610:17
[debug] [W3C]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[debug] [W3C]     at wrapped (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:60:13)
[debug] [W3C]     at retry (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:43:13)
[debug] [W3C]     at retryInterval (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\asyncbox\lib\asyncbox.js:70:10)
[debug] [W3C]     at C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-xcuitest-driver\lib\driver.js:559:7
[HTTP] <-- POST /wd/hub/session 500 32061 ms - 1437
[HTTP]
Forkey 回复

明天回公司看下 appium 版本,感觉像是 appium 版本不同导致的问题。

Forkey 回复

我们这边实际用远程启动好 wda 服务时的日志:

2021-06-18 18:55:34:442 [Appium] Welcome to Appium v1.21.0
2021-06-18 18:55:34:443 [Appium] Non-default server args:
2021-06-18 18:55:34:444 [Appium]   port: 20000
2021-06-18 18:55:34:444 [Appium]   sessionOverride: true
2021-06-18 18:55:34:444 [Appium]   logFile: public/serverLog/appium_20000_2021-06-18_18-55-33.log
2021-06-18 18:55:34:444 [Appium]   localTimezone: true
2021-06-18 18:55:34:461 [Appium] Appium REST http interface listener started on 0.0.0.0:20000
2021-06-18 18:55:34:634 [HTTP] --> GET /wd/hub/status
2021-06-18 18:55:34:634 [HTTP] {}
2021-06-18 18:55:34:635 [GENERIC] Calling AppiumDriver.getStatus() with args: []
2021-06-18 18:55:34:636 [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.21.0"}}
2021-06-18 18:55:34:639 [HTTP] <-- GET /wd/hub/status 200 5 ms - 68
2021-06-18 18:55:34:640 [HTTP] 
2021-06-18 18:55:35:066 [HTTP] --> POST /wd/hub/session
2021-06-18 18:55:35:066 [HTTP] {"desiredCapabilities":{"noReset":true,"xcodeOrgId":"F7YWW93M6T","bundleId":"xxx","skipLogCapture":true,"deviceName":"iPhone6s","wdaLocalPort":25000,"webDriverAgentUrl":"http://192.168.25.12:20474","waitForQuiescence":false,"newCommandTimeout":43200,"platformVersion":"14.5.1","automationName":"XCuiTest","useNewWDA":false,"wdaStartupRetries":0,"platformName":"iOS","udid":"xxx","wdaConnectionTimeout":1800000,"autoAcceptAlerts":true},"capabilities":{"firstMatch":[{"appium:autoAcceptAlerts":true,"appium:automationName":"XCuiTest","appium:bundleId":"xxx","appium:deviceName":"iPhone6s","appium:newCommandTimeout":43200,"appium:noReset":true,"platformName":"ios","appium:platformVersion":"14.5.1","skipLogCapture":true,"appium:udid":"xxx","appium:useNewWDA":false,"waitForQuiescence":false,"appium:wdaConnectionTimeout":1800000,"appium:wdaLocalPort":25000,"appium:wdaStartupRetries":0,"appium:webDriverAgentUrl":"http:/...
2021-06-18 18:55:35:066 [W3C] Calling AppiumDriver.createSession() with args: [{"noReset":true,"xcodeOrgId":"F7YWW93M6T","bundleId":"xxx","skipLogCapture":true,"deviceName":"iPhone6s","wdaLocalPort":25000,"webDriverAgentUrl":"http://192.168.25.12:20474","waitForQuiescence":false,"newCommandTimeout":43200,"platformVersion":"14.5.1","automationName":"XCuiTest","useNewWDA":false,"wdaStartupRetries":0,"platformName":"iOS","udid":"xxx","wdaConnectionTimeout":1800000,"autoAcceptAlerts":true},null,{"firstMatch":[{"appium:autoAcceptAlerts":true,"appium:automationName":"XCuiTest","appium:bundleId":"xxx","appium:deviceName":"iPhone6s","appium:newCommandTimeout":43200,"appium:noReset":true,"platformName":"ios","appium:platformVersion":"14.5.1","skipLogCapture":true,"appium:udid":"xxx","appium:useNewWDA":false,"waitForQuiescence":false,"appium:wdaConnectionTimeout":1800000,"appium:wdaLocalPort":25000,"appium:wdaStartupRetries":0,"appium:webDriverAgentUrl":"http://192.168.25.12:20474","appium:xc...
2021-06-18 18:55:35:067 [BaseDriver] Event 'newSessionRequested' logged at 1624013735067 (18:55:35 GMT+0800 (China Standard Time))
2021-06-18 18:55:35:069 [BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
2021-06-18 18:55:35:070 [BaseDriver]   skipLogCapture
2021-06-18 18:55:35:070 [BaseDriver]   waitForQuiescence
2021-06-18 18:55:35:729 [Appium] Appium v1.21.0 creating new XCUITestDriver (v3.43.0) session
2021-06-18 18:55:35:729 [Appium] There are no active sessions for cleanup
2021-06-18 18:55:35:731 [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
2021-06-18 18:55:35:731 [BaseDriver] Creating session with W3C capabilities: {
2021-06-18 18:55:35:731 [BaseDriver]   "alwaysMatch": {
2021-06-18 18:55:35:731 [BaseDriver]     "platformName": "ios",
2021-06-18 18:55:35:732 [BaseDriver]     "appium:skipLogCapture": true,
2021-06-18 18:55:35:732 [BaseDriver]     "appium:waitForQuiescence": false,
2021-06-18 18:55:35:732 [BaseDriver]     "appium:autoAcceptAlerts": true,
2021-06-18 18:55:35:732 [BaseDriver]     "appium:automationName": "XCuiTest",
2021-06-18 18:55:35:732 [BaseDriver]     "appium:bundleId": "xxx",
2021-06-18 18:55:35:732 [BaseDriver]     "appium:deviceName": "iPhone6s",
2021-06-18 18:55:35:732 [BaseDriver]     "appium:newCommandTimeout": 43200,
2021-06-18 18:55:35:732 [BaseDriver]     "appium:noReset": true,
2021-06-18 18:55:35:732 [BaseDriver]     "appium:platformVersion": "14.5.1",
2021-06-18 18:55:35:732 [BaseDriver]     "appium:udid": "xxx",
2021-06-18 18:55:35:732 [BaseDriver]     "appium:useNewWDA": false,
2021-06-18 18:55:35:733 [BaseDriver]     "appium:wdaConnectionTimeout": 1800000,
2021-06-18 18:55:35:733 [BaseDriver]     "appium:wdaLocalPort": 25000,
2021-06-18 18:55:35:733 [BaseDriver]     "appium:wdaStartupRetries": 0,
2021-06-18 18:55:35:733 [BaseDriver]     "appium:webDriverAgentUrl": "http://192.168.25.12:20474",
2021-06-18 18:55:35:733 [BaseDriver]     "appium:xcodeOrgId": "F7YWW93M6T"
2021-06-18 18:55:35:733 [BaseDriver]   },
2021-06-18 18:55:35:733 [BaseDriver]   "firstMatch": [
2021-06-18 18:55:35:733 [BaseDriver]     {}
2021-06-18 18:55:35:733 [BaseDriver]   ]
2021-06-18 18:55:35:733 [BaseDriver] }
2021-06-18 18:55:35:742 [BaseDriver] Session created with session id: 1f9c9767-7842-4635-8610-7adc9eee6738
2021-06-18 18:55:35:761 [XCUITest] Current user: 'lizhi'
2021-06-18 18:55:35:774 [XCUITest] Available devices: xxx
2021-06-18 18:55:35:775 [XCUITest] Creating iDevice object with udid 'xxx'
2021-06-18 18:55:35:775 [XCUITest] Determining device to run tests on: udid: 'xxx', real device: true
2021-06-18 18:55:35:775 [XCUITest] Normalized platformVersion capability value '14.5.1' to '14.5'
2021-06-18 18:55:35:776 [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1624013735775 (18:55:35 GMT+0800 (China Standard Time))
2021-06-18 18:55:35:776 [BaseDriver] Event 'appConfigured' logged at 1624013735776 (18:55:35 GMT+0800 (China Standard Time))
2021-06-18 18:55:35:776 [BaseDriver] Event 'resetStarted' logged at 1624013735776 (18:55:35 GMT+0800 (China Standard Time))
2021-06-18 18:55:35:777 [XCUITest] Reset: fullReset not set. Leaving as is
2021-06-18 18:55:35:777 [BaseDriver] Event 'resetComplete' logged at 1624013735777 (18:55:35 GMT+0800 (China Standard Time))
2021-06-18 18:55:35:777 [WebDriverAgent] Using WDA path: '/Users/lizhi/.nvm/versions/node/v12.22.1/lib/node_modules/appium/node_modules/appium-webdriveragent'
2021-06-18 18:55:35:777 [WebDriverAgent] Using WDA agent: '/Users/lizhi/.nvm/versions/node/v12.22.1/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'
2021-06-18 18:55:35:782 [XCUITest] 'skipLogCapture' is set. Skipping starting logs such as crash, system, safari console and safari network.
2021-06-18 18:55:35:782 [XCUITest] Setting up real device
2021-06-18 18:55:36:266 [DevCon Factory] Requesting connection for device xxx on local port 20474
2021-06-18 18:55:36:266 [DevCon Factory] Cached connections count: 0
2021-06-18 18:55:36:266 [DevCon Factory] Successfully requested the connection for xxx:20474
2021-06-18 18:55:36:267 [XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
2021-06-18 18:55:36:268 [XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval
2021-06-18 18:55:36:268 [BaseDriver] Event 'wdaStartAttempted' logged at 1624013736268 (18:55:36 GMT+0800 (China Standard Time))
2021-06-18 18:55:36:268 [WebDriverAgent] Using provided WebdriverAgent at 'http://192.168.25.12:20474'
2021-06-18 18:55:36:270 [WD Proxy] Matched '/status' to command name 'getStatus'
2021-06-18 18:55:36:270 [WD Proxy] Proxying [GET /status] to [GET http://192.168.25.12:20474/status] with no body
2021-06-18 18:55:36:287 [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"14.5","version":"14.5.1"},"ios":{"ip":"192.168.17.178"},"ready":true,"build":{"time":"May 25 2021 19:44:41","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null}
2021-06-18 18:55:36:288 [BaseDriver] Event 'wdaSessionAttempted' logged at 1624013736288 (18:55:36 GMT+0800 (China Standard Time))
2021-06-18 18:55:36:288 [XCUITest] Sending createSession command to WDA
2021-06-18 18:55:36:289 [WD Proxy] Matched '/session' to command name 'createSession'
2021-06-18 18:55:36:289 [WD Proxy] Proxying [POST /session] to [POST http://192.168.25.12:20474/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"xxx","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":false,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}}
2021-06-18 18:55:37:911 [WebDriverAgent] Parsed BUILD_DIR configuration value: '/Users/lizhi/.nvm/versions/node/v12.22.1/lib/node_modules/appium/node_modules/appium-webdriveragent/DerivedData/WebDriverAgent/Build/Products'
2021-06-18 18:55:37:911 [WebDriverAgent] Got derived data root: '/Users/lizhi/.nvm/versions/node/v12.22.1/lib/node_modules/appium/node_modules/appium-webdriveragent/DerivedData/WebDriverAgent'
2021-06-18 18:55:38:785 [WD Proxy] Got response with status 200: {"value":{"sessionId":"BE97DA3B-EB3D-4D16-8231-A8D18AA33E64","capabilities":{"device":"iphone","browserName":" ","sdkVersion":"14.5.1","CFBundleIdentifier":"com.apple.springboard"}},"sessionId":"BE97DA3B-EB3D-4D16-8231-A8D18AA33E64"}
2021-06-18 18:55:38:785 [WD Proxy] Determined the downstream protocol as 'W3C'
2021-06-18 18:55:38:786 [BaseDriver] Event 'wdaSessionStarted' logged at 1624013738786 (18:55:38 GMT+0800 (China Standard Time))
2021-06-18 18:55:38:786 [BaseDriver] Event 'wdaStarted' logged at 1624013738786 (18:55:38 GMT+0800 (China Standard Time))
2021-06-18 18:55:38:786 [XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior.
2021-06-18 18:55:38:786 [BaseDriver] Event 'orientationSet' logged at 1624013738786 (18:55:38 GMT+0800 (China Standard Time))
2021-06-18 18:55:38:786 [BaseDriver] The value of 'elementResponseAttributes' setting did not change. Skipping the update for it
2021-06-18 18:55:38:787 [BaseDriver] The value of 'shouldUseCompactResponses' setting did not change. Skipping the update for it
2021-06-18 18:55:38:787 [Appium] New XCUITestDriver session created successfully, session 1f9c9767-7842-4635-8610-7adc9eee6738 added to master session list
2021-06-18 18:55:38:788 [BaseDriver] Event 'newSessionStarted' logged at 1624013738787 (18:55:38 GMT+0800 (China Standard Time))
2021-06-18 18:55:38:788 [W3C (1f9c9767)] Cached the protocol value 'W3C' for the new session 1f9c9767-7842-4635-8610-7adc9eee6738
2021-06-18 18:55:38:788 [W3C (1f9c9767)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"ios","skipLogCapture":true,"waitForQuiescence":false,"autoAcceptAlerts":true,"automationName":"XCuiTest","bundleId":"xxx","deviceName":"iPhone6s","newCommandTimeout":43200,"noReset":true,"platformVersion":"14.5.1","udid":"xxx","useNewWDA":false,"wdaConnectionTimeout":1800000,"wdaLocalPort":25000,"wdaStartupRetries":0,"webDriverAgentUrl":"http://192.168.25.12:20474","xcodeOrgId":"F7YWW93M6T"}}
2021-06-18 18:55:38:789 [HTTP] <-- POST /wd/hub/session 200 3723 ms - 736

不过我们是在 mac 下运行的,不会出现你上面日志里的错误:[WebDriverAgent] Cannot retrieve WDA build settings. Original error: spawn xcodebuild ENOENT 。建议你根据日志看下源码,看是不是 appium 会不会不管是否要不要启动 wda ,都要检测 xcodebuild 是否存在?

如果是,要不改源码,要不可以往 path 搞个假的 xcodebuild ,让输出符合 appium 检测结果就行。

陈恒捷 回复

感谢,我研究下

陈恒捷 求助:linux ios 自动化部署问题 中提及了此贴 09月26日 23:49
陈恒捷 回复

想请教一下大佬,webDriverAgentUrl 只能设置本地环回地址吗,我设置成其他地址好像就不行(连接到局域网内其他 wda 地址),appium 会报 udid 找不到,我看官方文档也没说一定要设置成本地的地址

xuanhui 回复

这么说吧,webDriverAgentUrl 可以设置为任意地址,但你会因为 appium 更前面的一些流程卡住导致到不了用 webDriverAgentUrl 执行自动化这一步。

appium 在运行到连接 webDriverAgentUrl 前,还有一些前置步骤,如自动检测 udid 本地是否存在、检测被测 app 是否已安装等,这些步骤用的是 idevice_id 这类仅支持获取本地连接设备信息的工具进行的,所以如果设备不是本地连接,会在这些前置步骤里被卡住。

要解决的话,得手动改 appium 源码,让它跳过这类步骤。

陈恒捷 回复

明白了,感谢感谢

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册