1

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.

Luc
  • 5,339
  • 2
  • 48
  • 48
  • try AirDroid, or you can use adb tools to send command to your phone https://stackoverflow.com/a/4567928/6142219 – Deepak kaku Apr 26 '18 at 20:29
  • you can also send ADB commands over the air usin WIFI https://android.gadgethacks.com/how-to/send-adb-commands-over-wi-fi-android-0160216/ – Deepak kaku Apr 26 '18 at 20:29

0 Answers0