【发布时间】:2017-02-04 15:22:51
【问题描述】:
请帮忙解决我的问题
- 从genymotion网站下载带有VirtualBox的Genymotion并正确安装
- 在eclipse上添加Genymotion插件并设置Genymotion目录
- 添加虚拟设备 Nexus9 os 版本 5.1.0 API 22
- 在项目下添加Selenium和Appium java客户端jar文件
- 使用 Genymotion Android Tool 和 Custom Android SDK tool 作为 Genymotion ADB 工具连接设置
- 配置 Appium 设置并运行 appium
-
在源码下面运行
import java.io.IOException; import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.DefaultExecuteResultHandler; import org.apache.commons.exec.DefaultExecutor; import org.apache.commons.exec.ExecuteException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import java.net.URL; import io.appium.java_client.android.AndroidDriver; public class Firstappium { static String deviceName = "Nexus9-6.0.0-API23"; static WebDriver driver;; public static void main(String[] args) throws InterruptedException, ExecuteException, IOException { DesiredCapabilities capabilities = new DesiredCapabilities(); DefaultExecutor executor = new DefaultExecutor(); DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler(); capabilities.setCapability("deviceName","Nexus9-5.1.0API22"); capabilities.setCapability("platformVersion", "5.1"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability("app","G:/appium/apk/cz.hipercalc.apk"); driver = new AndroidDriver(new URL("http://127.0.0.1:4720/wd/hub"),capabilities); System.out.println("SetUp is successful and Appium Driver is launched successfully"); } } 在 Appium 登录下方显示
信息:[调试] 1 个设备已连接 信息:发现设备 adb 服务器版本 (32) 与此客户端 (36) 不匹配;杀... 信息:[调试] 将设备 ID 设置为 adb 服务器版本 (32) 与此客户端 (36) 不匹配;杀... 信息:[调试] 等待设备准备好并响应 shell 命令(超时 = 5) info: [debug] 执行 cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36);杀... 等待设备 信息:[调试]重试restartAdb 错误:运行等待设备时出错 info: [debug] 执行 cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36);杀... 杀死服务器 错误:杀死ADB服务器时出错,去看看它是否在线 信息:[调试]正在连接设备... info: [debug] 执行 cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36);杀... 设备 信息:[调试] 等待设备准备好并响应 shell 命令(超时 = 5) info: [debug] 执行 cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36);杀... 等待设备 错误:运行等待设备时出错 信息:[调试]重试restartAdb info: [debug] 执行 cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36);杀... 错误:运行等待设备时出错 info: [debug] 执行 cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36);杀... 杀死服务器 错误:杀死ADB服务器时出错,去看看它是否在线 信息:[调试]正在连接设备... info: [debug] 执行 cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36);杀... 设备 信息:[调试] 等待设备准备好并响应 shell 命令(超时 = 5) info: [debug] 执行 cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36);杀... 等待设备 错误:运行等待设备时出错 info: [debug] 发送关闭命令,等待 UiAutomator 停止... 警告:UiAutomator 没有足够快地关闭,称它消失了 信息:[调试] 清理 android 对象 信息:[调试] 清理 appium 会话 错误:无法启动 Appium 会话,错误为:错误:命令失败:C:\WINDOWS\system32\cmd.exe /s /c "G:\Android\sdk\platform-tools\adb.exe -s adb server版本 (32) 与此客户端 (36) 不匹配;正在杀死... 等待设备” 错误:无法安装 smartsocket 侦听器:无法绑定到 127.0.0.1:5037:每个套接字地址(协议/网络地址/端口)通常只允许使用一次。 (10048) 无法从 ADB 服务器读取 ok * 无法启动服务器 *
info: [debug] 错误:命令失败:C:\WINDOWS\system32\cmd.exe /s /c "G:\Android\sdk\platform-tools\adb.exe -s adb server version (32)不匹配此客户 (36);杀死... 等待设备” 错误:无法安装 smartsocket 侦听器:无法绑定到 127.0.0.1:5037:每个套接字地址(协议/网络地址/端口)通常只允许使用一次。 (10048) 无法从 ADB 服务器读取 ok * 无法启动服务器 *
at ChildProcess.exithandler (child_process.js:751:12) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1016:16) at Process.ChildProcess._handle.onexit (child_process.js:1088:5)info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: C:\WINDOWS \system32\cmd.exe /s /c \"G:\Android\sdk\platform-tools\adb.exe -s adb 服务器版本 (32) 与此客户端 (36) 不匹配;正在杀死...\r wait-for-device\"\n错误:无法安装 smartsocket 侦听器:无法绑定到 127.0.0.1:5037:每个套接字地址(协议/网络地址/端口)通常只允许使用一次. (10048)\r\n无法从 ADB 服务器读取 ok\r\n* 无法启动服务器 *\r\n)","killed":false,"code":4294967295,"signal":null," cmd":"C:\WINDOWS\system32\cmd.exe /s /c \"G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) 与此客户端不匹配 (36 );正在杀死...\r wait-for-device\"","origValue":"命令失败:C:\WINDOWS\system32\cmd.exe /s /c \"G:\Android\sdk\platform-tools\ adb.exe -s adb 服务器版本 (32) 与此客户端 (36) 不匹配;正在杀死...\r wait-for-device\"\n错误:无法安装 smartsocket 侦听器:无法绑定到 127.0.0.1:5037:每个套接字地址(协议/网络地址)只能使用一次/port) 通常是允许的。(10048)\r\n无法从 ADB 服务器读取 ok\r\n* 无法启动服务器 *\r\n"},"sessionId":null} 信息:
【问题讨论】:
标签: eclipse appium genymotion