我想通过Wi-Fi执行我的appium测试用例。 我已将设备设置为通过Xcode的网络连接并启动appium服务器的实例。但是,测试用例本身无法启动,因此我无法设置appium服务器。
我已将设备设置为通过Xcode通过网络连接并启动appium服务器实例。
继appium / stackoverflow论坛之后,尝试了可能的想法。
功能:
```DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, platformInfo[0]);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, platformInfo[1]);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
capabilities.setCapability(MobileCapabilityType.UDID, udid);
capabilities.setCapability("wdaLocalPort", wdaLocalPort);
capabilities.setCapability("app", absolutePath);
capabilities.setCapability("url",url);
capabilities.setCapability(MobileCapabilityType.ORIENTATION, "PORTRAIT");
capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
try {
driver = new IOSDriver(new URL(url),capabilities);
} catch (Exception e) {
System.out.println("Failed to setup Appium server");
}```
获取错误消息为:
```The following capabilities were provided, but are not recognized by appium: url.
[BaseDriver] Session created with session id: fcd01258-2ab6-42bf-9a2d-9ebdf350f084
(node:3643) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Beginning test with command 'xcodebuild test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=1abefa091b6c049f3701da9bf50fa42271e83f6e IPHONEOS_DEPLOYMENT_TARGET=12.1' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Output from xcodebuild will not be logged. To change this, use 'showXcodeLog' desired capability
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [XCUITest] Log file for xcodebuild test: /Users/ashwinirao/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/Test-WebDriverAgentRunner-2019.05.27_15-02-36-+0530.xcresult/1_Test/Diagnostics/WebDriverAgentRunner-3BE67333-CB20-4833-881B-A444C527595D/WebDriverAgentRunner-4BE4235F-FF51-4F66-AF00-1DDF587BE5F6/Session-WebDriverAgentRunner-2019-05-27_150236-AieKID.log
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [XCUITest] WebDriverAgent information:
[debug] [XCUITest] ""
[debug] [XCUITest] WebDriverAgent successfully started after 17007ms
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949567577 (15:02:47 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949570063 (15:02:50 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[debug] [JSONWP Proxy] Got response with status 200:
[JSONWP Proxy] Got an unexpected response:
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Cannot read property 'sessionId' of undefined). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949573553 (15:02:53 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949577062 (15:02:57 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949580657 (15:03:00 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /`enter code here`status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949584179 (15:03:04 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949587683 (15:03:07 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949591173 (15:03:11 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949594668 (15:03:14 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949598256 (15:03:18 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949601813 (15:03:21 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[HTTP] <-- POST /wd/hub/session - - ms - -
[HTTP]
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949603027 (15:03:23 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: ""
[debug] [JSONWP Proxy] Matched '/session' to command name 'createSession'
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"net.dubber.playbacks","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1558949606664 (15:03:26 GMT+0530 (India Standard Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}
[debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up). Retrying...
^Z
```