简体   繁体   English

在DesiredCapabilites中需要设置什么才能运行Applications应用程序?

[英]What has to be set in DesiredCapabilites to run Applications app?

On the Android platform there is a menu which shows all installed applications. 在Android平台上,有一个菜单显示所有已安装的应用程序。 My goal is to test this menu using Appium and Java language. 我的目标是使用Appium和Java语言测试此菜单。

As you can see in the attached image the package for this application is com.lge.launcher2 so the "appPackage" variable is known. 正如您在附加图像中看到的,此应用程序的包是com.lge.launcher2,因此“appPackage”变量是已知的。

UiAutomatorViewer

The problem is that I have to set proper DesiredCapabilities for "appActivity" as well and I have no idea where I can find this name. 问题是我必须为“appActivity”设置适当的DesiredCapabilities,我不知道在哪里可以找到这个名字。 Using adb shell I have grabbed all installed applications and there is "package:/system/priv-app/LGHome.apk=com.lge.launcher2" but when I set my DesiredCapabilities like this: 使用adb shell,我已经获取了所有已安装的应用程序,并且有“ package:/system/priv-app/LGHome.apk=com.lge.launcher2”,但是当我这样设置DesiredCapabilities时:

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("deviceName", "Android");
caps.setCapability("platformName", "Android");
caps.setCapability("appPackage", "com.lge.launcher2");
caps.setCapability("appActivity", "com.lge.launcher2.LGHome");

i got an error that "Activity used to start app doesn't exist or cannot be launched!". 我收到一个错误,“用于启动应用程序的活动不存在或无法启动!”。

So how I can run this Application Menu? 那么我如何运行这个应用程序菜单? Thanks a lot in advance for any hints! 非常感谢您的任何提示!

you can automate apps using appium to learn. 您可以使用appium自动化应用程序来学习。 download any sample app to ur machine, 下载任何示例应用程序到您的机器,

try adding ur app path that u have in ur local machine that need to be pushed to device using , 尝试添加您在本地计算机中需要推送到设备的应用程序路径,

 caps.setCapability("app", "C:\\Users\\...\\yourappname.apk");

to find the app activity name, in cmd prompt hit 在cmd提示符下找到应用程序活动名称

aapt dump badging "fullpath to ur apk in machine"

scroll down and find the value of the parameter 向下滚动并找到参数的值

launchable-activity

and replace it with your app package value in capablities 并将其替换为您在应用程序包中的应用程序包值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在ubuntu上运行android应用程序有哪些要求? - What are the requirements for android applications be run on ubuntu? 如何从Google chrome应用程序运行Java应用程序? - How to run the Java applications, from Google chrome app? 当我运行应用程序logcat时,请给我register.java文件中的3errors有人知道这可能是错误的吗? - When i run the app logcat give me 3errors in register.java file has anyone any idea what may be the wrong? 在tomcat上运行Java应用程序 - run java applications on tomcat FXML应用程序中必须完成的所有“整理”工作是什么? - What is all the “housekeeping” that has to be done in a FXML app? 禁止应用程序数字证书已通过验证您是否要运行此应用程序 - suppressing applications digital certificate has been verified do you want to run this application 运行应用程序的Java代码 - Java code to run applications 如何在Android上运行应用程序? - How is to run applications on Android? IntelliJ IDEA 运行应用程序 - IntelliJ IDEA Run applications 什么是在IntelliJ 2017.2“运行/调试配置”对话框中“在Tomcat实例中部署应用程序”? - What is “Deploy applications configured in Tomcat instance” in IntelliJ 2017.2 “Run/Debug Configurations” dialog?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM