문제

The reason why I intend to do this because I want to do some tests on my Android device.

I remember that there are some ways to implement this:

  1. Write a python script which can simulate the swipe event. Left, right, up and down. All events and speed should be configurable. This way can be done via adb.

  2. Android unit test.

  3. Can CTS archive the tests that I am expecting to have?

Is my understanding correct?

Kindly give me further information.

Thanks in advance

도움이 되었습니까?

해결책

You can use monkeyrunner with a python script: http://developer.android.com/tools/help/MonkeyDevice.html#drag

This blog post might help you with using monkeyrunner (it allows for getViewById in the mr script): http://dtmilano.blogspot.com/2012/03/monkeyrunner-running-unit-tests.html

You can use a ProcessBuilder in a JUnitTest to run monkeyrunner and test the output.

Once you have it working in a JUnitTest, you should be able to use them with CTS.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top