正确设置我的Android路径,但问题仍然存在。
代码:
AndroidDriver driver;
DesiredCapabilities cap=new DesiredCapabilities();
cap.setCapability("deviceName","");
cap.setCapability(CapabilityType.BROWSER_NAME, "Android");
cap.setCapability(CapabilityType.VERSION,"5.1.1");
cap.setCapability("platformName", "Android");
//cap.setCapability("app", "/data/app/../base.apk");
cap.setCapability("appPackage", "com...");
cap.setCapability("appActivity","com...");
System.out.println("Success 1");
driver=new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),cap);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Apppium console:s> info:[debug]将设备ID设置为03157df33c29520d
info:[debug]等待设备准备就绪并响应shell命令(timeout = 5) info:[debug]执行cmd:“D:\ softwares \ Android \ android-sdk-windows \ platform-tools \ adb.exe”-s 03157df33c29520d wait-for-device info:[debug]执行cmd:“D:\ softwares \ Android \ android-sdk-windows \ platform-tools \ adb.exe”-s 03157df33c29520d shell“echo'ready'” info:[debug]启动logcat捕获 错误:Logcat捕获失败:生成“D:\ softwares \ Android \ android-sdk-windows \ platform-tools \ adb.exe”ENOENT info:[debug]停止logcat捕获
请帮帮我??
答案 0 :(得分:0)
据我所知,您需要在〜/ .bashrc文件中设置ANDROID_HOME。在您的情况下,您应添加以下行:
export ANDROID_HOME=/Applications/AndroidSdk/sdk
首先检查设备中是否已启用开发人员选项,并且还安装了正确的设备驱动程序。还要重新验证是否已设置所需的最低功能。您还可以测试ADB是否通过命令lsusb
找到您的设备