Search code examples
androidintegration-testingandroid-uiautomator

How can multi-touch be used in uiautomator?


I haven't found any way to automate multi-touch movements in uiautomator tests

Given it's framework of com.android.uiautomator.* classes, how can I automate multi-touch movements?


Solution

  • Update 01 March 2017 When I first answered this question the current documentation for Android-17 e.g. http://developer.android.com/tools/help/uiautomator/UiObject.html did not seem to provide any way to provide multi-touch or other complex gestures such as pinch & zoom.

    However as @Project pointed out, multitouch gestures are now supported. https://developer.android.com/reference/androidx/test/uiautomator/UiObject#performmultipointergesture

    I have not tested this capability, at this stage.