Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions pages.zh/common/adb-shell-pm-list-packages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# adb shell pm list packages

> 列出安卓设备上,已安装的,已知的或经过自定义筛选后的程序包。
> 更多信息:<https://developer.android.com/tools/adb>.

- 列出所有已安装的程序包:

`adb shell pm list packages`

- 列出所有程序包,以及与它们关联的 APK 文件的路径:

`adb shell pm list packages -f`

- 仅列出禁用的程序包:

`adb shell pm list packages -d`

- 仅列出启用的程序包:

`adb shell pm list packages -e`

- 仅列出系统程序包:

`adb shell pm list packages -s`

- 仅列出第三方(非系统)的程序包:

`adb shell pm list packages -3`

- 显示每个包的安装来源:

`adb shell pm list packages -i`
32 changes: 32 additions & 0 deletions pages.zh/common/adb-shell-pm-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# adb shell pm list

> 列出程序包管理器中所管理的用户,程序包,权限,插桩测试 (instrumentation),权限组,功能和库。
> 更多信息:<https://developer.android.com/tools/adb>.

- 列出所有已安装的包:

`adb shell pm list packages`

- 显示系统上的所有用户:

`adb shell pm list users`

- 显示所有已知的权限组:

`adb shell pm list permission-groups`

- 显示所有已知的权限:

`adb shell pm list permissions`

- 显示所有的测试包:

`adb shell pm list instrumentation`

- 显示系统上的所有功能:

`adb shell pm list features`

- 显示当前设备支持的所有库:

`adb shell pm list libraries`
36 changes: 36 additions & 0 deletions pages.zh/common/adb-shell-pm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# adb shell pm

> 安卓程序包管理工具。
> 更多信息:<https://developer.android.com/tools/adb>.

- 列出已安装的包:

`adb shell pm list packages`

- 从指定路径,安装程序包:

`adb shell pm install /{{路径/到/程序包.apk}}`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adb shell pm install {{路径/到/程序包.apk}}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. This path is not right in English document. Would you mind updating this path?

Generally, the term '程序包' is not normally used. Instead, '软件包' or '应用包' are used, often abbreviated as '包'. Can you revise this section? This translation doesn't seem to align with common Chinese usage.

Copy link
Contributor Author

@SamHou0 SamHou0 Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the path should first be fixed in the original English document to keep consistency. As you see, this page has also been translated into French, and the translation there is also with /. For now, let just keep this, since this is a translation PR.

Generally, the term '程序包' is not normally used. Instead, '软件包' or '应用包' are used, often abbreviated as '包'. Can you revise this section? This translation doesn't seem to align with common Chinese usage.

I will do a replacement to fix this. Thanks for your suggestion.


- 从设备卸载一个包:

`adb shell pm uninstall {{程序包}}`

- 清除单个程序包的所有数据文件:

`adb shell pm clear {{程序包}}`

- 启用程序包或组件:

`adb shell pm enable {{包名_或_类名}}`

- 禁用程序包或组件:

`adb shell pm disable-user {{包名_或_类名}}`

- 为应用授予权限:

`adb shell pm grant {{包名}} {{android.permission.CAMERA|android.permission.ACCESS_FINE_LOCATION|android.permission.READ_CONTACTS|...}}`

- 撤销应用权限:

`adb shell pm revoke {{包名}} {{android.permission.CAMERA|android.permission.ACCESS_FINE_LOCATION|android.permission.READ_CONTACTS|...}}`