我一直在和 monkeyrunner 胡闹 - 抱歉不得不试着讲那个笑话。
我正在努力实现三件事:
1) 仅在我的应用完全启动并加载后才发送按键命中。在不依赖不可靠的 MonkeyRunner.sleep(3)
的情况下,我该如何做到这一点?
2) 如果可能的话,如何捕获我的应用程序(可滚动)的完整长度的屏幕截图?
3) 是否可以通过 monkeyrunner 将参数传递给我的应用程序,以便可以在应用程序中使用这些参数?
感谢大家的帮助
最佳答案
1) Only send key hits when my app has fully launched and loaded. How can I do this without relying on the unreliable MonkeyRunner.sleep(3)?
您需要使用 python 的子进程模块和 adb 的 logcat 来监控日志并查看您的应用程序何时打开。
2) How can I capture screenshots for the full length of my application (its scrollable), if at all possible?
如果您在真实设备上运行它,那么这是不可能的。如果您正在使用模拟器进行操作,那么只需将其设置为模拟器屏幕与您需要的屏幕截图一样大。
3) Is it possible to pass parameters to my application via the monkeyrunner so that these parameters can be used within the application?
是的,查看您拥有的选项here .
关于android - MonkeyRunner:更可靠的等待和全长截图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5930647/