Android下PM命令常見使用方法

2021-08-11 02:07:20 字數 2221 閱讀 4581

1.1:察看已安裝的包:

pm list package

此時則顯示所有已經安裝的包名。

pm list package -f

也顯示associated檔案所在目錄(即儲存的apk檔案)

1.2:察看已知的許可權組:

pm list permission-groups

1.3:察看所有已知的許可權

pm list permissions

1.4:列出所有硬體相關資訊

pm list features

結果通常類似:

feature:reqglesversion=0x20000

feature:android.hardware.bluetooth

feature:android.hardware.camera

feature:android.hardware.location

feature:android.hardware.location.network

feature:android.hardware.microphone

feature:android.hardware.sensor.accelerometer

feature:android.hardware.sensor.compass

feature:android.hardware.touchscreen

feature:android.hardware.wifi

1.5:列出指定包名的 

associated

檔案 (apk存檔檔案)

所在

例如:pm path com.tdijoy.fane

package:/mnt/asec/com.tdijoy.fane-1/pkg.apk

1.6: 安裝apk:

pm install [-l] [-r] [-t] [-i installer_package_name] [-s] [-f] path

path 指 apk檔案絕對路徑和檔名。

例如:pm install /data/3dijoy_fane.apk

這幾個引數很有用:

-r: 安裝乙個已經安裝的apk,保持其資料不變。

-i:指定安裝的包名。(沒試出來)

-s: 安裝到sdcard上

-f: 安裝到內部flash上。

1.6:解除安裝apk:

pm uninstall 包名。

例如:pm uninstall com.tdijoy.fane

1.7: 得到和設定預設安裝位置:

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

pm getinstalllocation

得到預設的安裝位置。

設定:pm setinstalllocation <0|1|2>

0: 自動。

1:內部flash。

2:擴充套件儲存裝置。

例項:如何在海信2.2 stb上將apk安裝到u盤中:

sam首先嘗試使用:

pm setinstalllocation 2

之後安裝之,沒有用。

後來做如下嘗試:

在其它設定

->

儲存裝置

->

制定預設儲存裝置中選擇

u盤為預設儲存裝置。

# pm install  

-s ***x.apk

就可以成功。

Android下pm 命令詳解

sam在看相關packagemanager 時,無意中發現android 下提供乙個pm命令,通常放在 system bin 下。這個命令與package有關,且非常實用。所以研究之。0.usage usage pm list path install uninstall pm list packa...

Android下pm命令詳解

在看相關packagemanager 時,無意中發現android 下提供乙個pm命令,通常放在 system bin 下。這個命令與package有關,且非常實用。所以研究之。0.usage usage pm list path install uninstall pm list packages...

android下m mm mmm編譯命令的使用

通過檢視android原始碼目錄下的build envsetup.s 件,可知 m makes from the top of the tree.mm builds all of the modules in the current directory.mmm builds all of the m...