Search code examples
androidadb

ADB media playback status


I am able to start a MP3 playback by using command

am start -W -n com.android.music/com.android.music.MediaPlaybackActivity -d /mp3file.mp3

I would like to loop mp3 continuously so that I don't have to start it again. For that there is no command to enable looping from adb shell. So I would like to ask if there is a way to check if MP3 playback is in progress from ADB without modifying the Android code?

I tried dumpsys audio, but it shows MediaPlaybackActivity even if the MP3 playing has stopped. Is there a way to find out if MediaplaybackActivity is actually playing MP3 or just stopped?


Solution

  • you could pass extras to the Activity to loop the music, there is no REAL way to control the behavior behind the Activity from adb unless you add the necessary hooks.

    Details

    https://developer.android.com/tools/help/shell.html