How can I play a mp3 file via adb command with goo

2019-06-05 10:12发布

I just have tried the old method of start to play a .mp3 file with adb command.

adb shell am start -n com.google.android.music/com.android.music.MediaPlaybackActivity -d /sdcard/Music/abc.mp3

But currently it does not work. Could any one help to check if there are any updated ways to do so?

2条回答
够拽才男人
2楼-- · 2019-06-05 10:51

Issue resolved by using command such as:

(file path: /storage/sdcard0/test.wav)

adb shell am start -a android.intent.action.VIEW -d file:///storage/sdcard0/test.wav -t audio/wav

(file path: /storage/emulated/0/test.wav)

adb shell am start -a android.intent.action.VIEW -d file:///storage/emulated/0/test.wav -t audio/wav
查看更多
Explosion°爆炸
3楼-- · 2019-06-05 10:53

Start Play:

adb shell am start -a android.intent.action.VIEW -d file:///storage/emulated/0/test.wav  -t audio/wav

To Close the Player:

adb shell input keyevent 4

To Stop the Player:

adb shell input keyevent 127

Pause/resume:

adb shell input keyevent 85
查看更多
登录 后发表回答