You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

设置包安装器时的目标名称是什么?执行pm set-installer命令报错的问题咨询

Hey there! Let's sort out your pm set-installer issue and clarify that target name question for you.

1. Fixing the "Must provide both target and package installer names" Error

That error pops up because your command is missing a critical required parameter: the target package name. The pm set-installer command needs two arguments to work properly, not just one.

The correct syntax is:

pm set-installer <TARGET_PACKAGE_NAME> <INSTALLER_PACKAGE_NAME>

For example, if you want to set Google's Package Installer as the default installer for the Twitter app (package name com.twitter.android), your command would look like this:

pm set-installer com.twitter.android com.google.android.packageinstaller
2. What Exactly Is the "Target Name"?

The "target name" here refers to the package name of the application you want to link to a specific installer.

To put it plainly:

  • You’re telling Android: "Whenever this [target app] needs to handle installation-related tasks (like updating itself or triggering other app installs), use the [installer package] you’ve specified."
  • This is per-app configuration—if you want a global default installer for all apps, you’ll need the pm set-default-installer command instead (note this requires system-level privileges).

Quick Example Breakdown

  • Target package: com.spotify.music (Spotify's app package name)
  • Installer package: com.google.android.packageinstaller (Google's default installer)
  • Command: pm set-installer com.spotify.music com.google.android.packageinstaller
  • Result: Spotify will use Google's Package Installer for any installation actions it performs.

内容的提问来源于stack exchange,提问作者Mike Grite

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 13:37:45