java 编写的在 window7 上执行,Android
手机数据线重新连接电脑,就一直停留在
code=ENOENT, errno=ENOENT, syscall=spawn
这行不动了
adb devices 是可以看到手机设备的
求解
然后又试了一下模拟器,一直停留在这里不动了
贴上对应模拟器的代码
@BeforeMethod
public void setUp() throws Exception {
// set up appium
File classpathRoot = new File(System.getProperty("user.dir"));
String a=classpathRoot.getName().toString();
File appDir = new File(classpathRoot,"/src/main/java/com/example/appiumApp/appiumApp/");
File app = new File(appDir, "AdDemo6.0.0.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("device","Android");
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability(CapabilityType.VERSION, "4.4");
capabilities.setCapability(CapabilityType.PLATFORM, "ANDROID");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("app-package", "com.mobisage.addemo7_0_0");
capabilities.setCapability("app-activity", ".SplashScreen");
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}