通过ADB Shell或终端获取应用程序名称/标签 [英] Get Application Name/ Label via ADB Shell or Terminal
问题描述
我正在开发一个使用ADB Shell与android设备连接的应用程序,并且我需要某种方式来打印出应用程序名称或应用程序标签(可能是其包名).
I'm developing an application that uses ADB Shell to interface with android devices, and I need some way of printing out the application name or label of an application, given maybe their package name.
简而言之,我需要一种通过adb shell
获取用户安装的应用程序的应用程序名称(即"Angry Birds v1.0.0")的方法.
In short, I need a way of getting app names (i.e. "Angry Birds v1.0.0") for user installed applications through adb shell
.
对此事有何看法?感谢您的任何帮助.
Any light on the matter? Any help is appreciated on this.
推荐答案
adb shell pm list packages
将为您提供所有已安装软件包名称的列表.
adb shell pm list packages
will give you a list of all installed package names.
然后您可以使用dumpsys | grep -A18 "Package \[my.package\]"
来获取软件包信息,例如版本标识符等
You can then use dumpsys | grep -A18 "Package \[my.package\]"
to grab the package information such as version identifiers etc
这篇关于通过ADB Shell或终端获取应用程序名称/标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!