0

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?

3
  • 2
    Please note that recommendations like Is there an app for X are off-topic here (see What topics can I ask about here? for details). For where your question might fit better, you might want to look into Where can I ask questions that aren't Android Enthusiast questions? and Where to ask for app recommendations?.
    – Izzy
    Commented Jan 31, 2022 at 8:28
  • Thanks @Izzy - good to know; in my defense, I hope that the question is clear, that I'm also interested in solution that would be just a bash script (e.g. like start stop daemon bash script) that could run in an Android shell, in which case I wouldn't really consider it "app recommendation" (and all of the marketing mess that comes out of that, which is, I guess, the mean reason sites want to discourage that). So, I hope this question is allowed to stand on this site ... EDIT: ah, bash script is off topic too, says the FAQ.. oh well, if this needs to be deleted, then delete it.
    – sdbbs
    Commented Jan 31, 2022 at 10:24
  • 1
    The reason I left it open was exactly your closing paragraph. May I suggest to rephrase your question along the lines of "how can I achieve this"? That would then totally be on-topic here – even if the answer might be an app, a shell script or any other software. Answering with an app that solves an issue is fine here – just explicitly asking for an app is not.
    – Izzy
    Commented Jan 31, 2022 at 16:55

0

You must log in to answer this question.

Browse other questions tagged .