An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s 00c1010789b19a81 shell pm install -r /data/local/tmp/b7ed81bab7c2b00214cfb3e923b039d9.apk' exited with code 1'; Stderr: 'Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed to parse /data/app/vmdl594265876.tmp/base.apk: AndroidManifest.xml]'; Code: '1'
非常奇怪的一点就是我一开始用 appium desktop 来启动安装 app 可以成功,而且 cap 并没有写 appPackage 和 appActivity。
之后我走 code 启动,出错显示 cap 需要 appPackage 和 appActivity,然后我加了以后就出现了上述的错误。最奇怪的就是之后我再使用 desktop 来启动也不行了,也说需要 appPackage 和 appActivity,加了以后再启动出现一样的错误。。。 我没辙了,求大神们帮忙。
cap 设置如下,device 是 android 的 udid
public void initializeAndroid(Apps a, String device, boolean noReset, boolean fullReset) {
cap.setCapability(MobileCapabilityType.DEVICE_NAME, device);
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.0");
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
cap.setCapability("appPackage", "com.sprylab.appiumtestapp");
cap.setCapability("appActivity", "com.sprylab.purple.android.app.purple.RoutingActivity");
File f = new File(username + appPath + a.file);
cap.setCapability("app", f.getAbsolutePath());
cap.setCapability("noReset", noReset);
cap.setCapability("fullReset", fullReset);
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap);
}