I was wondering, if there is some sort of an app, or a way, to run limited number of scripts or commands on an Android device over the network.
My use case is this: the device I have is inaccessible, and sometimes I'd like to turn it off, and turn the screen on. Since I cannot really touch the device to turn screen off (and use existing apps that deal with that use case), I'd like to have an app that starts a listening server on some port (say 7799) - which I could then access in a web browser on the local network via URL like, say, http:192.168.0.50:7799/run?script=screenoff.sh
, which when processed by the server, would then blackout the screen.
I'm aware that I could enable adb
(default port 5555) over TCP/IP (How can I connect to Android with ADB over TCP? - Stack Overflow), which basically enables this functionality - but I do not want the entire Android system open on the local network permanently. I'd just want to have only some functions (i.e. .sh
scripts, something that could run in adb
), that I myself choose, accessible/triggerable through a web server (that runs/keeps its port open permanently, and is thus started as a system service at boot of device).
Is there any application - or possibly, even a method in Android itself - that can be used for functionality like this?