gpt4 book ai didi

android - 如何阻止appium清除Android应用数据?

转载 作者:行者123 更新时间:2023-12-04 23:58:14 27 4
gpt4 key购买 nike

将我的 appium 版本升级到 1.6.3 后,我遇到了这个问题。每当我使用 driver.launchApp();命令,它清除应用程序数据 ,因此我无法执行下一个案例。

我也尝试设置以下所需功能,但每次尝试启动应用程序时它仍然会清除应用程序数据。

capabilities.setCapability("noReset", "true");

所以场景是,我登录到应用程序然后重新启动应用程序,appium 清除应用程序数据,再次出现不应出现的登录屏幕。

以下是我们可以清楚地看到appium正在清除应用数据的日志。
[debug] [ADB] Running 'C:\Users\Vinod\AndroidSDK\platform-tools\adb.exe' with args: ["-P",5037,"-s","079a1ea4d037eeb7","shell","am","force-stop","PACKAGENAME"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running 'C:\Users\Vinod\AndroidSDK\platform-tools\adb.exe' with args: ["-P",5037,"-s","079a1ea4d037eeb7","shell","pm","clear","PACKAGENAME"]
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running 'C:\Users\Vinod\AndroidSDK\platform-tools\adb.exe' with args: ["-P",5037,"-s","079a1ea4d037eeb7","shell","am","start","-W","-n","PACKAGENAME/.ui.SplashActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]

最佳答案

您需要在功能中添加以下代码

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("noReset", "true");
cap.setCapability("fullReset", "false");

它对我有用。

关于android - 如何阻止appium清除Android应用数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42246622/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com