Reputation: 5
I am trying to build a program with Eclipse that will send touch events via MonkeyRunner to an Android phone. However, I can't figure out how to get MonkeyRunner to work. I searched for questions similar to mine and found that there were several .jar dependencies, and I added them to Libraries under the Java Build Path, but it still fails (cannot be resolved) to do
import com.android.monkeyrunner.adb.AdbBackend;
import com.android.monkeyrunner.core.IMonkeyDevice;
import com.android.monkeyrunner.core.TouchPressType;
What else am I missing besides adding the .jars to the libraries?
Upvotes: 0
Views: 424
Reputation: 69208
If your intention is to send events from Java to a device you should use UIAutomator from the Testing Support Library.
UIAutomator provides a set of APIs to build tests that allow you to send events and interact with the applications on the device. Building with Eclipse may be difficult but not impossible, or you can use Android Studio and make your life easier.
However, if you just want to send events to the device and want to use a scripting language like python instead of Java, you can use AndroidViewClient/culebra which facilitates the creation of tests and scripts from a UI (see Culebra UI). It can also be used from Eclipse using PyDev or PyCharm.
Upvotes: 2