ADB commands for Music,Video and FM

1. How to launch music player and play music automatically?

To do so you have to use below adb command
adb shell am start -a android.intent.action.VIEW -d file:///sdcard/music/test.MP3 -t audio/mp3"

First you have to push a test.mp3 file on /sdcard/music this location. Once you fire the above adb command it will ask you to select the default player to play music if you have multiple music player installed on your device.


There are few keycodes events to handle the functionality of the music player
adb shell input keyevent 85
85 -->  "KEYCODE_MEDIA_PLAY_PAUSE"
86 -->  "KEYCODE_MEDIA_STOP"
87 -->  "KEYCODE_MEDIA_NEXT"
88 -->  "KEYCODE_MEDIA_PREVIOUS"
89 -->  "KEYCODE_MEDIA_REWIND"
90 -->  "KEYCODE_MEDIA_FAST_FORWARD"
91 -->  "KEYCODE_MUTE"


2. How to launch video player and play video automatically which is locally available on device?

To do so you have to use below adb command
adb shell am start -a android.intent.action.VIEW -d file:///sdcard/video.mp4 -t video/mp4"

First you have to push a video.mp4 file on /sdcard/video this location. Once you fire the above adb command it will ask you to select the default player to play video if you have multiple video player installed on your device.

 Once the default video player is selected by user the below video will played. These settings are one time settings and once done it will play all other future videos in this specific video player only.


3. How to launch FM?

Before you run this command just make sure you have inserted headset to the device as fm foes not function if you do not insert the headset. To do so you have to use below adb command
adb shell am start -n com.caf.fmradio/com.caf.fmradio.FMRadio 

5 comments:

  1. Nice Post
    Is there an adb command that runs an audio file in background for a specific time period so that the music app doesn't come on top of UI of the app being tested ??

    ReplyDelete
  2. Nice and interesting post, I appreciate your hard work. keep it up…!!!Thanks for such useful information, It is true that now if you want to grow your business you will surely need the mobile app testing services for your business. But for that purpose everyone needs best mobile app testing companies.

    ReplyDelete
  3. Very well written about music player. If you want videos of music player app, please download vidmate. There is a search box in Vidmate application where you can find whatever video or audio you want to download and you can easily find the video or audio of your choice. With the help of Vidmate application, you can download video and audio of any website as per your wish. You can bookmark the video in it and watch it later on the app whenever you want. You can also download music player app and Vidmate from 9apps

    ReplyDelete
  4. Thanks for Sharing Information to us. If Someone wants to know about Top Software testing Companies this is the Right place for you!

    ReplyDelete
  5. I have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks! come thru drake mp3

    ReplyDelete

Feature Posts

Python Appium - Step by step procedure for capturing screenshot

 Why To capture screenshot? It is as important as your logs. If there is any failure for any test scenario, we can provide screenshot for th...