用于启动应用程序的活动不存在(无法在 Android 5.1.1 中打开计算器应用程序) [英] Activity used to start app doesn't exist (Cannot open Calculator app in Android 5.1.1)
问题描述
我对 Appium 真的很陌生,所以如果这是一个重复的问题,请原谅.但是,我正在尝试使用 Appium 在 Android 5.1.1 上的计算器应用程序上运行一些测试,结果出现以下错误.
I'm really new to Appium so excuse me if its a repeat question. But, I'm trying to run some tests on the calculator app on Android 5.1.1 using Appium and it results in the following error.
错误:无法启动 Appium 会话,错误为:错误:活动用于启动的应用程序不存在或无法启动!确保它存在并且是一个可启动的活动
error: Failed to start an Appium session, err was: Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
信息:[调试] 错误:用于启动应用程序的活动不存在或无法启动!确保它存在并且是一个可启动的活动
info: [debug] Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
测试代码(功能):
capabilities.setCapability("appPackage", "SecCalculator2");
capabilities.setCapability("appActivity", "com.sec.android.app.popupcalculator.Calculator");
我已在手机上下载了APK 信息"应用,该应用显示以下信息.
I have downloaded the 'APK info' app on my phone and this app shows the following info.
APK路径:/system/app/SecCalculator2/SecCalculator2.apk
活动:com.sec.android.app.popupcalculator.Calculator
那么我在功能中使用了正确的包和活动名称吗?
So am I using the correct package and activity names in the capabilities?
提前致谢
推荐答案
您应该在所需的功能中添加应用程序文件名,如下所示:
You should add app file name in desired capabilities like below:
capabilities.setCapability("app", "/system/app/SecCalculator2/SecCalculator2.apk");
您也可以跳过添加appPackage"和appActivity"Appium自动启动apk文件中提到的应用程序.
Also you can skip to add "appPackage" and "appActivity" Appium automatically launch application which is mentioned in apk file.
希望对你有帮助.
这篇关于用于启动应用程序的活动不存在(无法在 Android 5.1.1 中打开计算器应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!