简体   繁体   English

如何构建Java Jar文件并在Android设备上运行UIAutomator?

[英]How to build a Java Jar file and run UIAutomator on an Android device?

I remember back at Motorola we were able to compile a Jar file, push the jar file onto the Android Device, and through cmd Prompt execute the jar file and call specific class files to run automation on the device. 我记得在摩托罗拉时,我们能够编译jar文件,将jar文件推送到Android设备上,并通过cmd提示执行jar文件并调用特定的类文件以在设备上运行自动化。 Problem is we had libraries already built and I didn't get a full understanding of how it worked. 问题是我们已经建立了库,但我对它的工作方式没有完全的了解。 All I remember was compiling the jar file through command prompt, then pushing it into the phone and calling the jar file thats on the phone with the name of the method that needed to be executed. 我只记得通过命令提示符编译jar文件,然后将其推入手机,并使用需要执行的方法名称调用手机上的jar文件。 then the phone started doing its thing. 然后电话开始执行其操作。 Does any one know how I can do this, or what the method is called so I can start researching it? 有谁知道我该怎么做,或者叫什么方法,以便我可以开始研究它?

The method you mentioned (pushing a jar) was used by previous versions and it's no longer required. 您提到的方法(推罐)已被以前的版本使用,不再需要。

You can read the details about the new Testing Support Library and UiAutomator here . 您可以在此处阅读有关新的测试支持库和UiAutomator的详细信息。

Basically. 基本上。 you create an APK with your tests, install it on the device under test and run the tests, which can be accomplished using adb so you don't need other external tools. 您可以使用测试创建一个APK,将其安装在被测设备上并运行测试,这可以使用adb来完成,因此您不需要其他外部工具。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM