You can execute adb commands through the network request.
Use adblib and nanohttpd, run on local.
- Connect adb by USB, restarting in TCP mode.
adb tcpip 5555
- Execute commands examples;
# curl
curl --location --request POST 'http://localhost:8999' \
--header 'Content-Type: text/plain' \
--data-raw 'input tap 500 500'
# Auto.js
http.post('http://localhost:8999', 'input tap 540 277', { contentType: 'text/plain' })