① 通過 ADB 命令卸載小米手機預裝軟體
為了卸載小米手機預裝軟體,您需要遵循以下步驟:
首先,確保您已下載並解壓了android SDK Platform工具包。工具包下載地址如下:
SDK平台工具版本說明 | Android開發者 | Android開發者網站
然後,將adb.exe、Adbwinapi.dll、Adbwinusbapi.dll三個文件復制到C:\Windows文件夾,這樣可以在cmd窗口中直接使用adb命令。這樣做的好處是節省操作時間,便於創建批處理文件。
在手機設置中開啟「開發者選項」和「USB調試」。接著,用數據線將手機連接到電腦。如果連接失敗,可能需要安裝手機驅動,小米官方的刷機工具中通常包含此功能。
在解壓的platform-tools文件夾中打開Powershell窗口。在該窗口中,您可以使用adb命令。先運行確認ADB連接是否正常的命令,若顯示手機設備編號,則表示連接成功。如果連接失敗,請嘗試更換USB埠或數據線。
要卸載軟體,您需要知道軟體的包名。在MIUI的「應用設置」中查看軟體列表。對於每個軟體,點擊其右上角的帶有小寫字母i的按鈕以打開「應用詳情」頁面,找到並記錄軟體包名。以小米錢包為例,其包名為com.mipay.wallet。
在禁用或卸載軟體前,建議先停止軟體運行。使用adb命令停止軟體運行,其中包名替換為目標軟體的名稱。要禁用軟體,使用特定命令;要恢復軟體,使用另一命令。要完全卸載軟體,使用刪除命令。
以下為執行步驟的命令示例:
停止運行命令示例:
禁用軟體命令示例:
恢復軟體命令示例:
卸載軟體命令示例:
當顯示「Success」字樣時,表示卸載成功。
在Windows cmd窗口中使用adb命令時,確保將adb.exe、Adbwinapi.dll、Adbwinusbapi.dll三個文件復制到C:\Windows文件夾,以便在cmd窗口中直接使用adb命令。
最後,列出可刪除的軟體列表,以供參考。請注意,實際可刪除的軟體取決於您的手機型號和MIUI版本。在Redmi K40手機上測試,使用這些步驟成功卸載了多個預裝軟體,且手機未出現變磚現象。
② android 中linux 命令pm常見用法(安裝卸載app)
27種用法格式 :
用法說明 :
1、 pm list packages : prints all packages, optionally only those whose package name contains the text in FILTER. Options:
例子:列出系統中所有packages
2、 pm list permission-groups : prints all known permission groups.
例子:
3、 pm list permissions : prints all known permissions, optionally only those in GROUP. Options:
例子:列出系統所有許可
4、 pm list instrumentation : use to list all test packages; optionally supply to list the test packages for a particular application. Options:
-f: list the .apk file for the test package.
5、 pm list features : prints all features of the system.
例子:列出所有手機特性
6、 pm list users : prints all users on the system.
例子:
7、 pm path : print the path to the .apk of the given PACKAGE.
例子:按包名查找apk文件所在路徑
8、 pm mp : print system state associated with the given PACKAGE.
9、 pm install : installs a package to the system. Options:
例子:
10、 pm uninstall : removes a package from the system. Options:
-k: keep the data and cache directories around after package removal. 保留數據
例子:
11、 pm clear : deletes all data associated with a package..
例子:只刪除數據
12、 pm enable, disable, disable-user, disable-until-used : these commands change the enabled state of a given package or component (written as "package/class").
13、 pm grant, revoke : these commands either grant or revoke permissions to applications. Only optional permissions the application has declared can be granted or revoked.
14、 pm get-install-location : returns the current install location.
15、 pm set-install-location : changes the default install location.
NOTE: this is only intended for debugging; using this can cause applications to break and other undersireable behavior.
16、 pm trim-caches : trim cache files to reach the given free space.
17、 pm create-user : create a new user with the given USER_NAME, printing the new user identifier of the user. 創建新用戶
18、 pm remove-user : remove the user with the given USER_IDENTIFIER, deleting all data associated with that user 。 按用戶ID刪除用戶