UiAutomator & monkey serve completely different things:
1. UIAutomator is intended for recording and executing specific UI test scenarios - like start app A, click on button X, input text into Edit Text Y, verify notification is displayed, second app is srtarted etc..
2. Monkey is intended for stress testing an app - it generates many random clicks, to make sure that the app does not crush after such 'crazy' usage.
You don't need UIAutomator to start Monkey, just run it directly as root.
On Tuesday, June 26, 2018 at 5:14:09 PM UTC+3, Judy wrote:
Recently our test team reported a issue about start monkey via uiautomator.
In uiautomator, start monkey by executeShellCommand(cmd), cmd is "monkey -s ..." same as start from adb shell dircetly.
we find, there are two problems:
1. monkey is running as system, not root, and its parent is 'app_process'
2. after one night test, monkey will stuck at System.err.println.
3. sometimes, in Uiautomator, kill monkey by executeShellCommand("kill -9 <pid>") will fail, monkey cannot be killed
If start by adb root shell, then no issue happen, monkey is running as root, parent is 'sh'.
My question is:
1. what is the difference between uiautomator and monkey? can then coexist?
2. why monkey's parent is app_process if start by uiautomator executeShellCommand?