I have to create an application that can perform adb operations on the user's device without an adb server running on a desktop machine. I stumbled upon ADB loopback, it consisted of adding a VPN/WIFI certificate on the device, then pairing the device locally and after that, the application is able to run adb commands from the application.
There was this github repo: https://web.archive.org/web/20201030143635/https://github.com/gersseba/android-touchlogger
Also, there is an application named Automate, which does the same thing. Does anyone know how can I do the same in Android java?