开发者

Can I use MonkeyRunner tool to work in mobile as application

I want to simulate touch event, keyboard event on mobile device. Can I do it with MonkeyRunner? Also, I have the impression that it only works with SDK?

I want the application to be installed on mobile, which will perform some random touch, keyboard events. Is it possibl开发者_JAVA技巧e with MonkeyRunner?

If yes, please provide me help on how to start writing python for mobile, and how to make project for android in Python. I have used Eclipse for java for android, but not for python.


I want to simulate touch event, keyboard event on mobile device. Can I do it with MonkeyRunner?

From your development machine, yes. Per your question title, you cannot use MonkeyRunner on a device.

Also, I have the impression that it only works with SDK?

Yes.

I want the application to be installed on mobile, which will perform some random touch, keyboard events. Is it possible with MonkeyRunner?

Fortunately, no, as this would be a massive security hole.


I have the impression that it only works with SDK?

MonkeyRunner uses adb (Android Debug Bridge) which comes with the SDK. However, if you install the SDK, that doesn't mean you also need to start it. You just need the adb tool to interact with your device.

I want to simulate touch event, keyboard event on mobile device. Can I do it with MonkeyRunner?

For key events, here is the list of key events supported by adb:
http://developer.android.com/reference/android/view/KeyEvent.html
These can be directly through adb and will the handled by the app that you have in foreground at that moment, or in some cases, like the Home button, will cause the Task Manager to appear.
If you do wish to use these for functional testing of your app, i recommend avoiding mnemonic menu selection, because menus change, and your scripts will require change also. :)

For Touch events i can recommend you ViewClient or Robotium. Personally, i prefer ViewClient, because it's easier to use.
http://dtmilano.blogspot.ro/2012/02/monkeyrunner-interacting-with-views.html

Mind you that ViewClient requires monkeyrunner. In its source, monkeyrunner is imported:

from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice


I want the application to be installed on mobile, which will perform some random touch, keyboard events. Is it possible with MonkeyRunner?

You want to use monkey to do this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜