我想列出Android设备的所有浏览器包名称
喜欢(chrome,Mozilla和UC浏览器)
是否有任何通用的adb命令?
答案 0 :(得分:6)
取决于您对browser
的定义。如果它是具有android.intent.category.APP_BROWSER
类别中已注册意图过滤器的应用程序 - 您可以使用以下adb shell
命令获取列表:
for P in $(pm list packages); do test -n "$(dumpsys package ${P#package:} | grep APP_BROWSER)" && echo ${P#package:}; done
答案 1 :(得分:2)
是否有任何通用的adb命令?
简短的回答是:否
目前,ADB shell仅支持自己的可用命令列表,您无法将它们过滤到浏览器等应用程序类型中。
adb shell pm list packages [options]
命令列表
adb shell pm list packages
adb shell pm list packages -f See their associated file.
adb shell pm list packages -d Filter to only show disabled packages.
adb shell pm list packages -e Filter to only show enabled packages.
adb shell pm list packages -s Filter to only show system packages.
adb shell pm list packages -3 Filter to only show third party packages.
adb shell pm list packages -i See the installer for the packages.
adb shell pm list packages -u Also include uninstalled packages.
adb shell pm list packages --user <USER_ID> The user space to query.