如何通過am 啓動一個電話:
am start -a android.intent.action.CALL -d tel:10010
如何使用alsa_aplay 播放一個本地raw文件.
alsa_aplay -C -Dhw:2,0 -r 8000 -c 1 -f S16 -t raw /d.raw
一、如果想通过adb shell播放一个mp3文件,可以通过以下的命令完成:
(1)通过am 播放音频文件
mp3 file located at /storage/sdcard0/Music/hello.mp3
adb shell am start -a "android.intent.action.VIEW" -t "audio/mp3" -d "file:///storage/sdcard0/Music/hello.mp3"
(2)通过am 播放视频文件:
For video playback, you can try this:
adb shell am start -a android.intent.action.VIEW -d "file:///mnt/sdcard/DCIM/Camera/test.3gp" -t "video/*"
gives you a prompt of all capable players that can play this file.
adb shell am start -a android.intent.action.VIEW -d "file:///mnt/sdcard/DCIM/Camera/test.3gp" -t "video/*" -n "com.alensw.PicFolder/.PlayerActivity"
二、也可以通过编译一个可执行文件来在终端运行,以下是一个例子:
http://stackoverflow.com/questions/26298306/android-adb-shell-command-to-play-sound-from-the-command-line/26329605#26329605