a tool that make android device to be a puppet
npm install kairaithis is a replacement for minicap(screen sharing) and minitouch(touch event generate)
for screen sharing using hidden api android.view.Surface.screenshot/SurfaceControl.screenshot.
for touch event generate using hidden api InputManager to inject MotionEvent.
> npm run-script build
will generate kairai.jar
> adb push kairai.jar /sdcard/
> export CLASSPATH=/sdcard/kairai.jar && exec app_process /sdcard com.lizhuo.huang.kairai.Screen
open a new terminal
> adb forward tcp:1313 localabstract:kminicap
now you can open 127.0.0.1:1313 to view the screen real time.
> export CLASSPATH=/sdcard/kairai.jar && exec app_process /sdcard com.lizhuo.huang.kairai.Touch
> adb forward tcp:1111 localabstract:minitouch
> nc localhost 1111
now you can generate touch event just like the minitouch check here for usage