Appium Appium1.13.0, iOS12.3.1 ,Xcode11.0 连接不上手机,请帮忙看下问题在哪?

季文洪 · 2019年09月29日 · 最后由 季文洪 回复于 2019年10月12日 · 3608 次阅读

The server is running
[Appium] Welcome to Appium v1.13.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/sessions
[HTTP] {}
[GENERIC] Calling AppiumDriver.getSessions() with args: []
[GENERIC] Responding to client with driver.getSessions() result: []
[HTTP] <-- GET /wd/hub/sessions 200 1 ms - 40
[HTTP]
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"bundleId":"com.apple.AppStore","deviceName":"iPhone","noReset":"True","platformName":"iOS","platformVersion":"12.3.1","udid":"2edc568fd5033fecba1a0856be0a20b56f4da635","xcodeOrgId":"YY68N7Z46L","xcodeSigningId":"iPhone Developer","newCommandTimeout":0,"connectHardwareKeyboard":true}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"bundleId":"com.apple.AppStore","deviceName":"iPhone","noReset":"True","platformName":"iOS","platformVersion":"12.3.1","udid":"2edc568fd5033fecba1a0856be0a20b56f4da635","xcodeOrgId":"YY68N7Z46L","xcodeSigningId":"iPhone Developer","newCommandTimeout":0,"connectHardwareKeyboard":true},null,null]
[BaseDriver] Event 'newSessionRequested' logged at 1569739735589 (14:48:55 GMT+0800 (CST))
[Appium] DeprecationWarning: 'automationName' capability was not provided. Future versions of Appium will require 'automationName' capability to be set for iOS sessions.
[Appium] Requested iOS support with version >= 10, using 'XCUITest' driver instead of UIAutomation-based driver, since the latter is unsupported on iOS 10 and up.
[Appium] Appium v1.13.0 creating new XCUITestDriver (v2.113.2) session
[Appium] Capabilities:
[Appium] bundleId: com.apple.AppStore
[Appium] deviceName: iPhone
[Appium] noReset: True
[Appium] platformName: iOS
[Appium] platformVersion: 12.3.1
[Appium] udid: 2edc568fd5033fecba1a0856be0a20b56f4da635
[Appium] xcodeOrgId: YY68N7Z46L
[Appium] xcodeSigningId: iPhone Developer
[Appium] newCommandTimeout: 0
[Appium] connectHardwareKeyboard: true
[BaseDriver] Creating session with MJSONWP desired capabilities: {"bundleId":"com.apple.AppS...
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Session created with session id: 0ccaeab5-b611-4249-9dc5-e16cabfe2c8c
[XCUITest] Current user: 'xdpi'
[XCUITest] Available devices: 2edc568fd5033fecba1a0856be0a20b56f4da635
[XCUITest] Creating iDevice object with udid '2edc568fd5033fecba1a0856be0a20b56f4da635'
[XCUITest] Determining device to run tests on: udid: '2edc568fd5033fecba1a0856be0a20b56f4da635', real device: true
[XCUITest] iOS SDK Version set to '13.0'
[BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1569739735616 (14:48:55 GMT+0800 (CST))
[BaseDriver] Event 'appConfigured' logged at 1569739735616 (14:48:55 GMT+0800 (CST))
[BaseDriver] Event 'resetStarted' logged at 1569739735616 (14:48:55 GMT+0800 (CST))
[XCUITest] Reset: fullReset not set. Leaving as is
[BaseDriver] Event 'resetComplete' logged at 1569739735616 (14:48:55 GMT+0800 (CST))
[iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[iOSLog] Starting iOS device log capture with: 'idevicesyslog'
[XCUITest] Cannot get the name of the crashes folder for the device with udid '2edc568fd5033fecba1a0856be0a20b56f4da635'. Original error: Command 'idevicename -u 2edc568fd5033fecba1a0856be0a20b56f4da635' exited with code 255
[BaseDriver] Event 'logCaptureStarted' logged at 1569739736329 (14:48:56 GMT+0800 (CST))
[XCUITest] Setting up real device
[XCUITest] Calling: 'ios-deploy --exists --id 2edc568fd5033fecba1a0856be0a20b56f4da635 --bundle_id com.apple.AppStore'
[XCUITest] Stdout: '[....] Waiting for iOS device to be connected
[XCUITest] [....] Using 2edc568fd5033fecba1a0856be0a20b56f4da635 (D20AP, D20AP, uknownos, unkarch) a.k.a. '蒲果的 iPhone'.
[XCUITest] true
[XCUITest] '
[XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[XCUITest] Parsed BUILD_DIR configuration value: '/Users/xdpi/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products'
[XCUITest] Got derived data root: '/Users/xdpi/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs'
[XCUITest] Starting WebDriverAgent initialization with the synchronization key '/Users/xdpi/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs'
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[XCUITest] WDA is not listening at 'http://localhost:8100/'
[XCUITest] WDA is currently not running. There is nothing to cache
[XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval
[XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[BaseDriver] Event 'wdaStartAttempted' logged at 1569739738400 (14:48:58 GMT+0800 (CST))
[XCUITest] Launching WebDriverAgent on the device
[XCUITest] Carthage found: '/usr/local/bin/carthage'
[XCUITest] Killing running processes 'xcodebuild.*2edc568fd5033fecba1a0856be0a20b56f4da635, iproxy 8100' for the device 2edc568fd5033fecba1a0856be0a20b56f4da635...
[XCUITest] 'pgrep -nif xcodebuild.*2edc568fd5033fecba1a0856be0a20b56f4da635' didn't detect any matching processes. Return code: 1
[XCUITest] 'pgrep -nif iproxy 8100' didn't detect any matching processes. Return code: 1
[XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB for the device 2edc568fd5033fecba1a0856be0a20b56f4da635
[XCUITest] iProxy is running and is listening on port #8100
[XCUITest] Generating xcode config file for orgId 'YY68N7Z46L' and signingId 'iPhone Developer'
[XCUITest] Writing xcode config file to /var/folders/77/p0b86p6n7nj_3v5b3g32c7pm0000gn/T/2019829-4147-29zyr3.cubpe/appium-temp.xcconfig
[XCUITest] Using Xcode configuration file: '/var/folders/77/p0b86p6n7nj_3v5b3g32c7pm0000gn/T/2019829-4147-29zyr3.cubpe/appium-temp.xcconfig'
[XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/xdpi/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs -destination id=2edc568fd5033fecba1a0856be0a20b56f4da635 IPHONEOS_DEPLOYMENT_TARGET=12.3 -xcconfig /var/folders/77/p0b86p6n7nj_3v5b3g32c7pm0000gn/T/2019829-4147-29zyr3.cubpe/appium-temp.xcconfig GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability
[XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[XCUITest] Log file for xcodebuild test: /Users/xdpi/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/Test-WebDriverAgentRunner-2019.09.29_14-49-00-+0800.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-A2057204-A1CD-4284-A66D-1B78E20EF942/WebDriverAgentRunner-053C9C67-95BA-494E-BAB2-C34E00E96D07/Session-WebDriverAgentRunner-2019-09-29_144901-C4QN1Q.log
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got response with status 200: "{\n \"value\" : {\n \"message\" : \"WebDriverAgent is ready to accept commands\",\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"12.3.1\",\n \"sdkVersion\" : \"13.0\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"12.3.1\",\n \"ip\" : \"192.168.44.157\"\n },\n \"ready\" : true,\n \"build\" : {\n \"upgradedAt\" : \"1569722406589\",\n \"time\" : \"Sep 29 2019 14:37:36\",\n \"productBundleIdentifier\" : \"com.facebook.WebDriverAgentRunner\"\n }\n },\n \"sessionId\" : \"3947A756-BF96-4766-A343-1B3101D8BAA8\"\n}"
[WD Proxy] Determined that the downstream protocol for proxy is W3C
[XCUITest] WebDriverAgent information:
[XCUITest] {
[XCUITest] "message": "WebDriverAgent is ready to accept commands",
[XCUITest] "state": "success",
[XCUITest] "os": {
[XCUITest] "name": "iOS",
[XCUITest] "version": "12.3.1",
[XCUITest] "sdkVersion": "13.0"
[XCUITest] },
[XCUITest] "ios": {
[XCUITest] "simulatorVersion": "12.3.1",
[XCUITest] "ip": "192.168.44.157"
[XCUITest] },
[XCUITest] "ready": true,
[XCUITest] "build": {
[XCUITest] "upgradedAt": "1569722406589",
[XCUITest] "time": "Sep 29 2019 14:37:36",
[XCUITest] "productBundleIdentifier": "com.facebook.WebDriverAgentRunner"
[XCUITest] }
[XCUITest] }
[XCUITest] WebDriverAgent successfully started after 6469ms
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739745215 (14:49:05 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739746225 (14:49:06 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739747239 (14:49:07 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739748252 (14:49:08 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739749267 (14:49:09 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739750284 (14:49:10 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739751301 (14:49:11 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739752319 (14:49:12 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739753330 (14:49:13 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739754347 (14:49:14 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739755357 (14:49:15 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739756368 (14:49:16 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739757381 (14:49:17 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739758394 (14:49:18 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[BaseDriver] Event 'wdaSessionAttempted' logged at 1569739759405 (14:49:19 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.AppStore","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"3947A756-BF96-4766-A343-1B3101D8BAA8"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[XCUITest] SessionNotCreatedError: A new session could not be created. Details: 'capabilities' is mandatory to create a new session
[XCUITest] at errorFromW3CJsonCode (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:802:25)
[XCUITest] at ProxyRequestError.errorFromW3CJsonCode as getActualError
[XCUITest] at JWProxy.getActualError as command
[XCUITest] Unable to start WebDriverAgent session because of xcodebuild failure: A new session could not be created. Details: 'capabilities' is mandatory to create a new session 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.
[XCUITest] Quitting and uninstalling WebDriverAgent
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down iproxy process (pid 5312)
[XCUITest] iproxy exited with code 'null'
[XCUITest] Shutting down xcodebuild process (pid 5313)
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[XCUITest] Removing WDA application from device
[XCUITest] Error: Unable to start WebDriverAgent session because of xcodebuild failure: A new session could not be created. Details: 'capabilities' is mandatory to create a new session 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.
[XCUITest] at quitAndUninstall (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:501:15)
[XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on.
[iOSLog] Stopping iOS log capture
[BaseDriver] Event 'newSessionStarted' logged at 1569739759609 (14:49:19 GMT+0800 (CST))
[MJSONWP] Encountered internal error running command: Error: Unable to start WebDriverAgent session because of xcodebuild failure: A new session could not be created. Details: 'capabilities' is mandatory to create a new session 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.
[MJSONWP] at quitAndUninstall (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:501:15)
[HTTP] <-- POST /wd/hub/session 500 24022 ms - 538
[HTTP]
[HTTP] --> DELETE /wd/hub/session
[HTTP] {}
[HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- DELETE /wd/hub/session 404 2 ms - 57
[HTTP]

最佳回复

已经解决,被坑了两礼拜。。。解决过程如下 (注意第二步操作😂 ):

Xcode 执行 Product- test 成功,会在 iPhone 上安装 WebDriverAgent
手动卸载掉 WebDriverAgent
打开 Appium,连接 iphone(过程中会安装 WebDriverAgent ),连接成功。

@ 对酒当歌

共收到 6 条回复 时间 点赞

[XCUITest] "productBundleIdentifier": "com.facebook.WebDriverAgentRunner"

日志里面的这段信息,"com.facebook.WebDriverAgentRunner",不是我的
Xcode 打开的 WebDriverAgent.xcodeproj 里面,都改成自己的了。

sh-3.2# sh ./Scripts/bootstrap.sh -d
-e Fetching dependencies
*** Checking out CocoaAsyncSocket at "7.6.3"
*** Checking out RoutingHTTPServer at "v1.0.2"
*** Checking out YYCache at "1.1.0"
*** xcodebuild output can be found in /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/carthage-xcodebuild.VoQKDS.log
*** Downloading CocoaAsyncSocket.framework binary at "Version 7.6.3"
*** Building scheme "RoutingHTTPServer tvOS" in RoutingHTTPServer.xcodeproj
*** Building scheme "RoutingHTTPServer iOS" in RoutingHTTPServer.xcodeproj
*** Building scheme "YYCache tvOS" in YYCache.xcodeproj
*** Building scheme "YYCache iOS" in YYCache.xcodeproj
sh-3.2#

现在这个脚本执行成功就这样?

直接在 xcode 里面能 build success 吗,可以的话,把 appium 日志里面的那段 xcodebuild 命令拿出来执行以下,看有没有报错。我这边碰到的情况是刚开始用 appium 直接运行 WebdriverAgent 起不来,但是命令行去 xcodebuild 一下,再去用 apiium 就可以。

xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/_appium-webdriveragent@1.3.0@appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=xxxxxx IPHONEOS_DEPLOYMENT_TARGET=12.4 -xcconfig /var/folders/hb/3hpnn6l177358k6s5vv2v1ch0000gn/T/2019818-1480-i5tmyl.99okk/appium-temp.xcconfig GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO

也遇到楼主一样的问题😨

[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session","traceback":""},"sessionId":"226942E2-886E-4293-887C-71C15863468C"}
[W3C] Matched W3C error code 'session not created' to SessionNotCreatedError
[XCUITest] Failed to create WDA session (A new session could not be created. Details: 'capabilities' is mandatory to create a new session). Retrying...
[XCUITest] SessionNotCreatedError: A new session could not be created. Details: 'capabilities' is mandatory to create a new session
[XCUITest] at errorFromW3CJsonCode (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:802:25)
[XCUITest] at ProxyRequestError.errorFromW3CJsonCode as getActualError
[XCUITest] at JWProxy.getActualError as command
[XCUITest] Unable to start WebDriverAgent session because of xcodebuild failure: A new session could not be created. Details: 'capabilities' is mandatory to create a new session 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.
[XCUITest] Quitting and uninstalling WebDriverAgent
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down iproxy process (pid 2712)
[XCUITest] iproxy exited with code 'null'
[XCUITest] Shutting down xcodebuild process (pid 2713)
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[XCUITest] Removing WDA application from device
[XCUITest] Error: Unable to start WebDriverAgent session because of xcodebuild failure: A new session could not be created. Details: 'capabilities' is mandatory to create a new session 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.
[XCUITest] at quitAndUninstall (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:501:15)
[XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on.
[iOSLog] Stopping iOS log capture
[BaseDriver] Event 'newSessionStarted' logged at 1570212696333 (02:11:36 GMT+0800 (CST))
[MJSONWP] Encountered internal error running command: Error: Unable to start WebDriverAgent session because of xcodebuild failure: A new session could not be created. Details: 'capabilities' is mandatory to create a new session 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.
[MJSONWP] at quitAndUninstall (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:501:15)
[HTTP] <-- POST /wd/hub/session 500 29009 ms - 538
[HTTP]
[HTTP] --> DELETE /wd/hub/session
[HTTP] {}
[HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- DELETE /wd/hub/session 404 3 ms - 57
[HTTP]

KevinWang 回复

在 Xcode 里面 test 的时候没有报错。
命令行执行 Failed,但是我看 WebDriverAgentLib 里面账号是 ok 的。

sh-3.2# xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/xdpi/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs -destination id=2edc568fd5033fecba1a0856be0a20b56f4da635 IPHONEOS_DEPLOYMENT_TARGET=12.3 -xcconfig /var/folders/77/p0b86p6n7nj_3v5b3g32c7pm0000gn/T/2019829-4147-29zyr3.cubpe/appium-temp.xcconfig GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO
Ignoring configuration file '/var/folders/77/p0b86p6n7nj_3v5b3g32c7pm0000gn/T/2019829-4147-29zyr3.cubpe/appium-temp.xcconfig' because it could not be loaded.
Reason: File could not be parsed due to preprocessing errors:
The file “appium-temp.xcconfig” couldn’t be opened because there is no such file. (/var/folders/77/p0b86p6n7nj_3v5b3g32c7pm0000gn/T/2019829-4147-29zyr3.cubpe/appium-temp.xcconfig) User defaults from command line:
IDEDerivedDataPathOverride = /Users/xdpi/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs

Build settings from command line:
COMPILER_INDEX_STORE_ENABLE = NO
GCC_TREAT_WARNINGS_AS_ERRORS = 0
IPHONEOS_DEPLOYMENT_TARGET = 12.3

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: No profiles for 'com.xdpi.webdrive' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.xdpi.webdrive'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'IntegrationApp')

Build system information
error: No profiles for 'com.xdpi.webdrive' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.xdpi.webdrive'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'WebDriverAgentRunner')

Build system information
error: WebDriverAgentLib has conflicting provisioning settings. WebDriverAgentLib is automatically signed, but code signing identity Apple Development has been manually specified. Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor. (in target 'WebDriverAgentLib')

** TEST BUILD FAILED **

已经解决,被坑了两礼拜。。。解决过程如下 (注意第二步操作😂 ):

Xcode 执行 Product- test 成功,会在 iPhone 上安装 WebDriverAgent
手动卸载掉 WebDriverAgent
打开 Appium,连接 iphone(过程中会安装 WebDriverAgent ),连接成功。

@ 对酒当歌

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