pm (package manager)

    技术2022-05-18  32

    位置: Android/frameworks/base/cmds/pm

    1.Android.mk:

    LOCAL_PATH:= $(call my-dir)include $(CLEAR_VARS)

    LOCAL_SRC_FILES := $(call all-subdir-java-files)LOCAL_MODULE := pminclude $(BUILD_JAVA_LIBRARY)

    include $(CLEAR_VARS)ALL_PREBUILT += $(TARGET_OUT)/bin/pm$(TARGET_OUT)/bin/pm : $(LOCAL_PATH)/pm | $(ACP)        $(transform-prebuilt-to-target)

    2. cat pm:

    # Script to start "pm" on the device, which has a very rudimentary# shell.#base=/systemexport CLASSPATH=$base/framework/pm.jarexec app_process $base/bin com.android.commands.pm.Pm "$@"

     

    3. pm.java 编译生成 pm.jar (com.android.commands.pm.Pm.class)

     

    4. pm bash script论帮忙信息

     

    usage: pm [list|path|install|uninstall]       pm list packages [-f]       pm list permission-groups       pm list permissions [-g] [-f] [-d] [-u] [GROUP]       pm list instrumentation [-f] [TARGET-PACKAGE]       pm list features       pm path PACKAGE       pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f]       pm uninstall [-k] PACKAGE       pm enable PACKAGE_OR_COMPONENT       pm disable PACKAGE_OR_COMPONENT       pm setInstallLocation [0/auto] [1/internal] [2/external]

    The list packages command prints all packages.  Options:  -f: see their associated file.

    The list permission-groups command prints all knownpermission groups.

    The list permissions command prints all knownpermissions, optionally only those in GROUP.  Options:  -g: organize by group.  -f: print all information.  -s: short summary.  -d: only list dangerous permissions.  -u: list only the permissions users will see.

    The list instrumentation command prints all instrumentations,or only those that target a specified package.  Options:  -f: see their associated file.

    The list features command prints all features of the system.

    The path command prints the path to the .apk of a package.

    The install command installs a package to the system.  Options:  -l: install the package with FORWARD_LOCK.  -r: reinstall an exisiting app, keeping its data.  -t: allow test .apks to be installed.  -i: specify the installer package name.  -s: install package on sdcard.  -f: install package on internal flash.

    The uninstall command removes a package from the system. Options:  -k: keep the data and cache directories around.after the package removal.

    The enable and disable commands change the enabled state ofa given package or component (written as "package/class").

    The getInstallLocation command gets the current install location  0 [auto]: Let system decide the best location  1 [internal]: Install on internal device storage  2 [external]: Install on external media

    The setInstallLocation command changes the default install location  0 [auto]: Let system decide the best location  1 [internal]: Install on internal device storage  2 [external]: Install on external media 

     

    5. pm list packages, pm pm list permission-groups, etc .....


    最新回复(0)