Testing tools

Monkey is Android SDK testing tool that comes, sends a pseudo-random to the system during the test user event stream, such as a key input, touch screen input, gesture input etc.), to achieve the application being developed pressure tests, there are log output. In fact, the tool can only do do some stress testing program, because the test events and data are random, can not be customized, so there are a lot of limitations.

Monkey test must be entered before the android devices adb shell (Android SDK environment configuration is not described here, there are many online) as follows:

  1. Start -> Run -> cmd
  2. connect the USB phone, enter adb shell command, appears to be following entries
  3. After entering the phone, enter the appropriate command to test monkey

adb shell monkey -p package -v number of tests
  such as "adb shell monkey -p com.htc.Weather -v 20000 " is meant com.htc.Weather this package once 20,000 individual monkey test
  in which the package name sentence can be obtained in the serial console command: ls data / data show all packages
  with Monkey test to test, in order to facilitate analysis of the problem, at the command can be followed by the monkey "| logcat -v time", so that the test can be side-edge printing Log (remember to save Log text terminal) For example:
  adb shell monkey -v -p com.htc.Weather 20000 | logcat -v time
  but this combination monkey after the test is completed, logcat still being executed, you need to pay attention to the test.
  If the test monkey encounter crash or ANR (mandatory program exit or does not respond) phenomenon, while the need to provide gripping log traces.txt, the following steps:
  1. test version requires root privileges
  2. enter data / anr directory below
  3. traces.txt copy files to TF card, copy and send out software to analyze

Guess you like

Origin www.cnblogs.com/yiluxiangbeis/p/10962647.html