如何使用ADB Shell获取在Android 8软件包中安装的所有软件的清单? 我偏爱查询Sqlite基础,但是接受任何命令行解决方案。
答案 0 :(得分:4)
adb shell cmd package list packages
这将返回设备上安装的应用程序的软件包名称的列表。每行都以package:
为前缀。
您甚至可以使用某些选项:
list packages [-f] [-d] [-e] [-s] [-3] [-i] [-l] [-u] [-U] [--uid UID] [--user USER_ID] [FILTER]
Prints all packages; optionally only those whose name contains
the text in FILTER.
Options:
-f: see their associated file
-d: filter to only show disabled packages
-e: filter to only show enabled packages
-s: filter to only show system packages
-3: filter to only show third party packages
-i: see the installer for the packages
-l: ignored (used for compatibility with older releases)
-U: also show the package UID
-u: also include uninstalled packages
--uid UID: filter to only show packages with the given UID
--user USER_ID: only list packages belonging to the given user
较旧的Android版本的替代方法是
adb shell pm list packages
但已不建议使用,将来有可能将其删除。
答案 1 :(得分:2)
使用以下方法获取所有已安装的软件包:
adb shell pm list packages
查看用户安装的软件包:
adb shell pm list packages -3"|cut -f 2 -d ":