简体   繁体   English

如何使用终端获取android设备上所有应用程序的列表

[英]How to get the list of all apps on android device using terminal

there is a command line to get package name:-有一个命令行来获取包名:-

adb shell pm list packages 

But how to get the list of all applications on the device但是如何获取设备上所有应用程序的列表

Previously the command for listing installed packages used to be pm list packages .以前列出已安装包的命令是pm list packages But as of Android nougat, the command has been removed.但是从 Android nougat 开始,该命令已被删除。 The new command to do the same is cmd package list packages .执行相同操作的新命令是cmd package list packages

Your question already contains the answer in itself: Running a terminal, you enter the shell .您的问题本身已经包含答案:运行终端,您进入shell So simply omit that part ( adb shell ) from your command, and run the pm command directly:因此,只需从您的命令中省略该部分 ( adb shell ),并直接运行pm命令:

pm list packages

should produce the very same output.应该产生完全相同的输出。 pm isn't part of ADB (or the adb shell ) command, but rather an executable shipping with Android: The p ackage m anager. pm是不ADB的部分(或adb shell命令),而是与Android可执行航运:所述p ackageanager。 So you can use its full potential:所以你可以充分利用它的潜力:

pm list packages [options] 
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.
   -u: Also include uninstalled packages.
   --user : The user space to query.

Enjoy!享受!

Also to save list of apps to txt use this command:此外,要将应用程序列表保存到 txt,请使用以下命令:

adb shell pm list packages -f > d:\1.txt

or if you want to save file to adb folder just use或者如果您想将文件保存到 adb 文件夹,只需使用

adb shell pm list packages -f > installed-apps.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM