请大家帮忙,真机 usb 调试已经打开
代码:
DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("app-package", "com.example.testandriror");
//caps.SetCapability("browserName", "");
caps.SetCapability("device", "Selendroid");//模拟器 Android
caps.SetCapability("app-activity", "com.example.testandriror.MainActivity");
caps.SetCapability("takesScreenshot", true);
caps.SetCapability("version", "2.3");//模拟器 4.4
caps.SetCapability("device ID", "samsung-gt_i9103-43c720043e061d7");//模拟器没这行
caps.SetCapability("app", @"C:\TestAndriror.apk");
RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://127.0.0.1:4723/wd/hub"), caps);
模拟器可以连上,正常操作,真机连接报错如下:
A new session could not be created. (Original error: Command failed: Exception in thread "main" java.lang.RuntimeException: Unable to rename input apk. C:\TestAndriror.apk
at s.Sign.sign(Sign.java:421)
at s.Sign.main(Sign.java:532)
) (33)