pm包管理命令
pm 命令详解
pm即package manager,使用pm命令可以去模拟android行为或者查询设备上的应用信息等
list packages [-f] [-d] [-e] [-s] [-3] [-i] [-l] [-u] [-U]
[--show-versioncode] [--apex-only] [--uid UID] [--user USER_ID] [FILTER]
Prints all packages; optionally only those whose name contains
the text in FILTER. Options are:
-f: see their associated file
-a: all known packages (but excluding APEXes)
-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
--show-versioncode: also show the version code
--apex-only: only show APEX packages
--uid UID: filter to only show packages with the given UID
--user USER_ID: only list packages belonging to the given user
显示安装了多少应用
adb shell pm list packages
显示安装了多少系统应用
adb shell pm list packages -s | wc -l
显示安装了多少第三方应用
adb shell pm list packages -3
删除与包相关的所有数据:清除数据和缓存.相当于重新安装
adb shell pm clear com.xiya.radar.wifi
命令 功能 实现方法
dump dump信息 AM.dumpPackageStateStatic
clear 清空App数据 AMS.clearApplicationUserData
uninstall [options] 卸载应用 IPackageInstaller.uninstall
force-dex-opt dex优化 PMS.forceDexOpt
trim-caches <目标size> 紧缩cache目标大小 PMS.freeStorageAndNotify
list packages 列举app包信息 PMS.getInstalledPackages
get-install-location 获取安装位置 PMS.getInstallLocation
path 查看App路径 PMS.getPackageInfo
install [options] 安装应用 PMS.installPackageAsUser
hide 隐藏应用 PMS.setApplicationHiddenSettingAsUser
unhide 显示应用 PMS.setApplicationHiddenSettingAsUser
enable <包名或组件名> enable PMS.setEnabledSetting
disable <包名或组件名> disable PMS.setEnabledSetting
set-install-location 设置安装位置 PMS.setInstallLocation
get-max-users 最大用户数 UserManager.getMaxSupportedUsers
————————————————
原文链接:https://blog.csdn.net/Picasso_L/article/details/78683405
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!