设置包安装器时的目标名称是什么?执行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-installercommand 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
相关产品推荐
相关产品推荐

