Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play one audio file in android using adb command?

Tags:

android

adb

I am having one android target.
I have some audio file in mnt/sdcard0.
How can I play through adb command?
Music player application is already installed in the target.

like image 650
user3664681 Avatar asked Dec 24 '22 19:12

user3664681


2 Answers

use the following adb shell command:

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

like image 140
balu b Avatar answered Jan 09 '23 15:01

balu b


There are two other command line programs which may work via a adb shell or even remotely using an ssh connection. Neither need an installed music player app.

adb shell stagefright -a -o file.mp3

and

adb shell tinyplay file.wav

(drop adb shell if not using an adb connection)

Note that tinyplay can only play stereo wav files. I found out about the stagefright command from a3nm's blog: Android from the command-line.

like image 20
MJ Walsh Avatar answered Jan 09 '23 13:01

MJ Walsh