环境:
jdk 版本:"1.8.0_31"
appium 版本:1.6.3
selenium:3.0.1
java-client:5.0.0-BETA3

参数设置 capabilities.setCapability( "automationName","uiautomator2"):

DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
    capabilities.setCapability("platformName", "Android");
    capabilities.setCapability("deviceName", "Android Emulator");   
    capabilities.setCapability("platformVersion", appbean.getPlatformVersion() );
     capabilities.setCapability("udid", appbean.getUid());
//  capabilities.setCapability("app", app.getAbsolutePath());   
    //capabilities.setCapability( "automationName","Selendroid");//这句话设置可以获取toast 消息
     capabilities.setCapability( "automationName","uiautomator2");
    capabilities.setCapability("appPackage", "com.orvibo.homemate");
    capabilities.setCapability("appActivity", "com.orvibo.homemate.common.launch.LaunchActivity");
    capabilities.setCapability("unicodeKeyboard", "True");  
    capabilities.setCapability("resetKeyboard", "True");  
    //capabilities.setCapability("setWebContentsDebuggingEnabled", "True"); 
    //capabilities.setCapability("noSign", "True");
    capabilities.setCapability("noReset", true);//实现app不是每次都安装

启动测试时提示:

testng 提示:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Command 'D\:\\android-sdk5.0\\android-sdks\\build-tools\\android-4.3\\aapt.exe dump badging C\:\\Users\\test1\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\.0.2.9\@appium-uiautomator2-driver\\uiautomator2\\appium-uiautomator2-server-v0.1.1.apk' exited with code 1 (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 20.18 seconds
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42'
System info: host: 'test', ip: '192.168.18.223', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_31'
Driver info: io.appium.java_client.android.AndroidDriver

有谁碰到过这个情况么?


↙↙↙阅读原文可查看相关链接,并与作者交流