To perform certain actions on my Android device, I typically need to build an app which triggers the right OS features.
Example 1: I'd like to be able to turn on Spotify without having to go to my phone and actually open the app: this could be done by turning the screen on and then launching it so it's in the foreground, after which I can use Spotify on my laptop to delegate playing.
Example 2: I'd like to set an alarm for in 8 hours after my audio book stopped (it stops automatically when I fall asleep), for which I need to call AudioManager.isMusicActive()
and an intent to set the alarm.
These things would be simple to write and modify if I could use shell scripting on my phone, instead of a >1GiB SDK and my laptop.
How could I do this without having to create an app for every little thing? Or is there someone who made an app which I can call from a shell script (e.g. using a restful api on localhost) to perform such commands on demand? Root is of course available.