What exactly is a monkey doing messing with my Android phone?

蓝咒 提交于 2019-11-30 01:12:00

问题


Looking through the Android apis I found a method call isUserAMonkey(), says it returns true if the phone is being messed with by a monkey.

Is this a joke, or what is it used for?


回答1:


Look at monkeyrunner, it will give you the answer.

Quote from the document:

The monkeyrunner tool provides an API for writing programs that control an Android device or emulator from outside of Android code. With monkeyrunner, you can write a Python program that installs an Android application or test package, runs it, sends keystrokes to it, takes screenshots of its user interface, and stores screenshots on the workstation. The monkeyrunner tool is primarily designed to test applications and devices at the functional/framework level and for running unit test suites, but you are free to use it for other purposes.

So if you are running a package using Monkeyrunner, then this function will return true.



来源:https://stackoverflow.com/questions/7546402/what-exactly-is-a-monkey-doing-messing-with-my-android-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!