4

我一直在和猴子奔跑者胡闹——抱歉不得不试着讲那个笑话。

我正在努力实现三件事:

1) 仅在我的应用程序完全启动和加载时发送按键命中。我怎么能不依赖不可靠的来做到这一点MonkeyRunner.sleep(3)

2) 如果可能的话,我如何捕获整个应用程序(可滚动)的屏幕截图?

3)是否可以通过monkeyrunner将参数传递给我的应用程序,以便可以在应用程序中使用这些参数?

谢谢大家的帮助

4

1 回答 1

6

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)?

You would need to use python's subprocess module with adb's logcat to monitor the log and see when your app opened.

2) How can I capture screenshots for the full length of my application (its scrollable), if at all possible?

If you are running this on a real device then it is not possible. If you are doing things with an emulator then just make it so the emulator screen is as big as you need the screen shot to be.

3) Is it possible to pass parameters to my application via the monkeyrunner so that these parameters can be used within the application?

Yes, see the options that you have here.

于 2011-06-18T00:39:11.960 回答