Your version of SDK tools has nothing to do with the parameters input
can understand or execute. Input is a binary in Android OS which can be run independently without requiring any set of external tools such as ADB.
The reason you receive the error "Error: Unknown command: touchscreen
" is because you're running an Android version earlier than Android 4.1.1. You would already notice that in the input
usage you posted, the binary entertains only two parameters i.e. text
and keyevent
.
In Android 4.0.x, the input
command's usage remains the same as the one you posted. In fact, even Android 2.3.7 has the same input command's usage. (See com.android.commands.input.Input on GrepCode for comparison of command's usage between Android versions.)
It was Android 4.1.1 which introduced tap
and swipe
parameter with usage,
usage: input ...
input text <string>
input keyevent <key code number or name>
input tap <x> <y>
input swipe <x1> <y1> <x2> <y2>
See the source code for more.
input
. What options does it show? Is your Android version beyond 4.4?