擷取、參考:
https://forum.xda-developers.com/t/2021-10-01-remove-system-apps-on-realme-ui-2-0-using-adb.4115531/
https://github.com/termux/termux-app/issues/2015
https://zhuanlan.zhihu.com/p/148420664
透過ADB停用不需要的系統應用程式
從使用者停用/移除應用程式
內容擷取自此XDA文章,作者: prathameshsd
使用 ADB 在 Realme UI 2.0 上刪除系統應用程式
上傳於 : [2021/10/01]
Notes:
- 此方法不應刪除您的手機資料,但始終對手機進行完整備份以確保安全。
- 此方法解除安裝/停用使用者 0 的應用程式。它不會從系統分割區中物理刪除應用程式。
要求:
- 您的 Realme 6 執行基於 Android 11 的 Realme UI 2.0
- 一台裝有 Windows/Linux/MacOS 的電腦
- 安裝 ADB + Fastboot 驅動程式: https://www.xda-developers.com/install-adb-windows-macos-linux/
- 配置 ADB + Fastboot 介面 : https://www.xda-developers.com/adb-fastboot-any-directory-windows-linux/
- 重要提示:將手機連接到 PC 後,從通知選單中啟用“透過 USB 進行檔案傳輸”,否則 ADB 將無法運作。
- 為獲得最佳效果,請直接將以下指令複製貼上到終端機內。
解除安裝系統應用程式
Code:
adb shell pm uninstall -k --user 0 <package.name.of.the.app>
列出您已解除安裝的所有系統應用程式
Code:
adb shell "(pm list packages -u && pm list packages) | sort | uniq -u | cut -c 9-"
重新安裝系統應用程式
Code:
adb shell cmd package install-existing <package.name.of.the.app>
在 Linux 系統一次重新安裝所有解除安裝的系統應用程式
Code:
for i in $(adb shell "(pm list packages -u && pm list packages) | sort | uniq -u | cut -c 9-") ; do adb shell cmd package install-existing "$i" ; done
停用一個系統應用程式
Code:
adb shell pm disable-user --user 0 <package.name.of.the.app>
列出您已停用的所有系統應用程式
Code:
adb shell "pm list packages -d | cut -c 9-"
重新啟用一個系統應用程式
Code:
adb shell pm enable --user 0 <package.name.of.the.app>
在 Linux 系統重新啟用所有停用的系統應用程式
Code:
for i in $(adb shell "(pm list packages -d | sort | cut -c 9-)") ; do adb shell pm enable --user 0 "$i" ; done
Code:
# AOSP & Google Apps
adb shell pm uninstall -k --user 0 com.android.chrome
adb shell pm uninstall -k --user 0 com.android.hotwordenrollment.okgoogle
adb shell pm uninstall -k --user 0 com.android.stk
adb shell pm uninstall -k --user 0 com.google.android.apps.nbu.paisa.user
adb shell pm uninstall -k --user 0 com.google.android.feedback
adb shell pm uninstall -k --user 0 com.google.android.googlequicksearchbox
adb shell pm uninstall -k --user 0 com.google.android.youtube
# ColorOS & Oppo Apps
adb shell pm uninstall -k --user 0 com.coloros.assistantscreen
adb shell pm uninstall -k --user 0 com.coloros.backuprestore
adb shell pm uninstall -k --user 0 com.coloros.childrenspace
adb shell pm uninstall -k --user 0 com.coloros.compass2
adb shell pm uninstall -k --user 0 com.coloros.healthcheck
adb shell pm uninstall -k --user 0 com.coloros.healthservice
adb shell pm uninstall -k --user 0 com.coloros.personalassistant.overlay.common
adb shell pm uninstall -k --user 0 com.coloros.phonemanager
adb shell pm uninstall -k --user 0 com.coloros.securepay
adb shell pm uninstall -k --user 0 com.coloros.securitykeyboard
adb shell pm uninstall -k --user 0 com.coloros.video
adb shell pm uninstall -k --user 0 com.coloros.weather.service
adb shell pm uninstall -k --user 0 com.oppo.quicksearchbox
adb shell pm uninstall -k --user 0 com.oppo.music
# Facebook Apps
adb shell pm uninstall -k --user 0 com.facebook.appmanager
adb shell pm uninstall -k --user 0 com.facebook.services
adb shell pm uninstall -k --user 0 com.facebook.system
# Heytap Apps
# You can remove all if you dont use Realme/Heytap online account
adb shell pm disable-user --user 0 com.heytap.market
adb shell pm disable-user --user 0 com.heytap.themestore
adb shell pm uninstall -k --user 0 com.heytap.browser
adb shell pm uninstall -k --user 0 com.heytap.cloud
adb shell pm uninstall -k --user 0 com.heytap.habit.analysis
adb shell pm uninstall -k --user 0 com.heytap.mcs
adb shell pm uninstall -k --user 0 com.heytap.openid
adb shell pm uninstall -k --user 0 com.heytap.pictorial
adb shell pm uninstall -k --user 0 com.heytap.usercenter
# Nearme & Realme Apps
# Secure Payment Protection Feature
adb shell pm uninstall -k --user 0 com.nearme.atlas
adb shell pm uninstall -k --user 0 com.realme.securitycheck
# Red Tea Mobile Apps
# Get new SIM, recharge data plans when abroad.
adb shell pm uninstall -k --user 0 com.redteamobile.roaming
adb shell pm uninstall -k --user 0 com.redteamobile.roaming.deamon
# Tencent Apps
adb shell pm uninstall -k --user 0 com.tencent.soter.soterserver
Credits:
Doug Lynch of XDA Portal : https://www.xda-developers.com/author/doug-lynch/
Original Article : https://www.xda-developers.com/uninstall-carrier-oem-bloatware-without-root-access
從使用者停用/移除更新服務
此方式參考自: 如何彻底关闭OPPO手机系统更新 作者: 红耳小水兽
停用更新服務
# OTA Service
adb shell pm disable-user com.oppo.ota
adb shell pm disable-user com.coloros.sau
adb shell pm disable-user com.oppo.otaui
解除安裝更新服務
# OTA Service
adb shell pm uninstall -k --user 0 com.oppo.ota
adb shell pm uninstall -k --user 0 com.coloros.sau
adb shell pm uninstall -k --user 0 com.oppo.otaui
實作
實作於 Realme X50 PRO (Android 11, Realme UI 2.0)
自訂的停用腳本:
實測若停用 com.coloros.weather.service 會導致系統 UI 崩潰,在此註解掉
athena 會 kill 掉 Termux 的 Process,且無 GUI 可以停用,參考 Termux 的 issues 直接 ADB 幹掉:
adb shell pm uninstall -k –user 0 com.coloros.athena
# AOSP & Google Apps
# adb shell pm uninstall -k --user 0 com.android.chrome
# adb shell pm uninstall -k --user 0 com.android.hotwordenrollment.okgoogle
# adb shell pm uninstall -k --user 0 com.android.stk
# adb shell pm uninstall -k --user 0 com.google.android.apps.nbu.paisa.user
# adb shell pm uninstall -k --user 0 com.google.android.feedback
# adb shell pm uninstall -k --user 0 com.google.android.googlequicksearchbox
adb shell pm disable-user --user 0 com.google.android.youtube
# ColorOS & Oppo Apps
adb shell pm uninstall -k --user 0 com.coloros.assistantscreen
adb shell pm uninstall -k --user 0 com.coloros.backuprestore
adb shell pm uninstall -k --user 0 com.coloros.childrenspace
adb shell pm uninstall -k --user 0 com.coloros.compass2
adb shell pm uninstall -k --user 0 com.coloros.healthcheck
adb shell pm uninstall -k --user 0 com.coloros.healthservice
adb shell pm uninstall -k --user 0 com.coloros.personalassistant.overlay.common
adb shell pm uninstall -k --user 0 com.coloros.phonemanager
adb shell pm uninstall -k --user 0 com.coloros.securepay
adb shell pm uninstall -k --user 0 com.coloros.securitykeyboard
adb shell pm uninstall -k --user 0 com.coloros.video
# adb shell pm uninstall -k --user 0 com.coloros.weather.service
adb shell pm uninstall -k --user 0 com.oppo.quicksearchbox
adb shell pm uninstall -k --user 0 com.oppo.music
# Facebook Apps
adb shell pm uninstall -k --user 0 com.facebook.appmanager
adb shell pm uninstall -k --user 0 com.facebook.services
adb shell pm uninstall -k --user 0 com.facebook.system
# Heytap Apps
# You can remove all if you dont use Realme/Heytap online account
adb shell pm disable-user --user 0 com.heytap.market
adb shell pm disable-user --user 0 com.heytap.themestore
adb shell pm uninstall -k --user 0 com.heytap.browser
adb shell pm uninstall -k --user 0 com.heytap.cloud
adb shell pm uninstall -k --user 0 com.heytap.habit.analysis
adb shell pm uninstall -k --user 0 com.heytap.mcs
adb shell pm uninstall -k --user 0 com.heytap.openid
adb shell pm uninstall -k --user 0 com.heytap.pictorial
adb shell pm uninstall -k --user 0 com.heytap.usercenter
# Nearme & Realme Apps
# Secure Payment Protection Feature
adb shell pm uninstall -k --user 0 com.nearme.atlas
adb shell pm uninstall -k --user 0 com.realme.securitycheck
# Red Tea Mobile Apps
# Get new SIM, recharge data plans when abroad.
adb shell pm uninstall -k --user 0 com.redteamobile.roaming
adb shell pm uninstall -k --user 0 com.redteamobile.roaming.deamon
# Tencent Apps
adb shell pm uninstall -k --user 0 com.tencent.soter.soterserver
# I had the same issue regarding Athena service killing some background processes. apparently it can be disabled using adb:
adb shell pm uninstall -k --user 0 com.coloros.athena
# OTA Service
adb shell pm uninstall -k --user 0 com.oppo.ota
adb shell pm uninstall -k --user 0 com.coloros.sau
adb shell pm uninstall -k --user 0 com.oppo.otaui