是否有 ADB 命令来检查媒体是否正在播放 [英] Is there an ADB command to check a media is playing or not

查看:119
本文介绍了是否有 ADB 命令来检查媒体是否正在播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查音频/视频是否正在使用 ADB 命令根植于终端的外部设备中播放.如果可用,我找不到任何 ADB 命令提及

I want to check whether the Audio/Video is playing in my external device which is rooted in terminal using ADB command.I am not able to find any ADB commands if available mention that

我试过 adb shell dumpsys media.player

I have tried adb shell dumpsys media.player

我想要一个命令来指定视频是否正在运行

i want a command to specify if video is running or not

推荐答案

要打印出 MediaPlayer 状态:

To print out the MediaPlayer states:

adb shell dumpsys audio

但这将显示整个设备的输出.像这样:

But this will show the output of entire device. Like so:

06-25 14:11:02:226 new player piid:1343 uid/pid:10080/26372 type:android.media.MediaPlayer attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
06-25 14:11:02:249 player piid:1343 state:started
06-25 14:35:13:911 releasing player piid:1343
06-25 14:35:20:570 new player piid:1351 uid/pid:10080/29715 type:android.media.MediaPlayer attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
06-25 14:35:20:598 player piid:1351 state:started
06-25 14:35:29:720 releasing player piid:1351
06-25 14:36:34:263 new player piid:1359 uid/pid:10080/29715 type:android.media.MediaPlayer attr:AudioAttributes: usage=USAGE_UNKNOWN content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null
06-25 14:36:34:304 player piid:1359 state:started

您可以使用它来获取应用程序的 PID,然后检查 MediaPlayer 的状态:

You can use this to get the PID of your app and then check the state of the MediaPlayer:

adb shell pidof -s your.package.name

这篇关于是否有 ADB 命令来检查媒体是否正在播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆