This article will introduce how to install or uninstall a system app from adb command in Android.
1. Uninstall a system app
The following command will unintall the com.google.android.youtube
package installed as System app on User 0
. If the --user
option is omitted, it will be set to User 0
by default.
$ adb shell pm uninstall --user 0 com.google.android.youtube
Success
You can check if it has been deleted with the following command.
From the result, installed=false
means it has been deleted. Since it is a system app and the Apk file will not be deleted, it will be handled by setting the installed status to false under the hood.
$ adb shell dumpsys package com.google.android.youtube
Packages:
Package [com.google.android.youtube] (3d1fcc2):
userId=10121
pkg=Package{b77ead3 com.google.android.youtube}
codePath=/product/app/YouTube
flags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP KILL_AFTER_RESTORE RESTORE_ANY_VERSION LARGE_HEAP ]
....
User 0: ceDataInode=0 installed=false hidden=false suspended=false distractionFlags=0 stopped=true notLaunched=true enabled=0 instant=false virtual=false
User 0 represents the user of the System, and when multiple users are created, different user spaces such as User 10, User 11 are created.
2. Install a system app
The following command will install the system app com.google.android.youtube
that was uninstalled previously by the above command.
$ adb shell pm install-existing --user 0 com.google.android.youtube
Package com.google.android.youtube installed for user: 0
You can check if the package is installed with the following command. installed=true
means that it is installed.
$ adb shell dumpsys package com.google.android.youtube
Packages:
Package [com.google.android.youtube] (3d1fcc2):
userId=10121
pkg=Package{b77ead3 com.google.android.youtube}
codePath=/product/app/YouTube
flags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP KILL_AFTER_RESTORE RESTORE_ANY_VERSION LARGE_HEAP ]
....
User 0: ceDataInode=0 installed=true hidden=false suspended=false distractionFlags=0 stopped=true notLaunched=true enabled=0 instant=false virtual=false
Related Posts
- How to download and build Android 13, AOSP
- Notification permission request, pop up notification in Android 13
- Resolve `Access blocked: ComponentInfo` error on Android 13
- Fix error "android gradle plugin requires java 11 to run. you are currently using java 1.8."
- Android - Vibration, Vibrator, VibrationEffect example
- How to get phone number in Android
- How to create Bugreports and Logcat with ADB in Android
- Clear application user data with ADB in Android
- How to disable/enable apps with ADB in Android
- How to find PID of a package with adb in Android
- How to grant/revoke permissions with adb in Android
- How to install an apk(app) with adb in Android
- How to kill a process/package from ADB in Android
- How to transfer files using adb push/pull command in Android
- How to capture the screen from adb in Android
- How to uninstall/install system apps from adb in Android
- How to change Settings values from adb in Android
- How to Factory reset with ADB in Android
- How to get logcat from ADB command in Android
- How to capture Heap Dump from app with ADB in Android
- How to force stop an app with adb in Android
- How to start/stop a service from adb in Android
- How to send/broadcast an intent from adb command in Android
- How to start an activity from adb in Android
- How to generate input from adb in Android
- How to check SQLite DB table in Android Studio
- How to get memory info and thread list from adb in Android
- Android - Uri, Scheme and SSP(Scheme Specific Part)
- How to parse a xml file with XmlResourceParser in Android
- Android - Signing an apk with Platfom key
- How to fix "Cleartext HTTP ... not permitted" for Android development
- How to fix "kvm permission denied" for Android Emulator
- Using ADB over Wifi for Android development