This article will introduce how to install an apk(app) or delete a package(app) with adb in Android.
1. "adb install APK_FILE"
The following command installs the YouTube.apk
file located on the PC.
$ adb install YouTube.apk
Performing Streamed Install
Success
1.1 Install the apk file on the device.
The following command installs the apk file stored in the /data/local/tmp/YouTube.apk
path of the device.
$ adb shell pm install /data/local/tmp/YouTube.apk
Success
Unfortunately, if you try to install the file "/sdcard/YouTube.apk" with this command, it will fail due to permission issues. Because adb couldn't get access to that directory like "/sdcard/", But, The path under "/data/local/tmp/" is possible, so, you should move it to "/data/local/tmp/" before installing if you want to install it.
$ adb shell pm install /sdcard/YouTube.apk
avc: denied { read } for scontext=u:r:system_server:s0 tcontext=u:object_r:fuse:s0 tclass=file permissive=0
System server has no access to read file context u:object_r:fuse:s0 (from path /sdcard/YouTube.apk, context u:r:system_server:s0)
Error: Unable to open file: /sdcard/YouTube.apk
Consider using a file under /data/local/tmp/
Error: Can't open file: /sdcard/YouTube.apk
2. "adb uninstall PACKAGE_NAME"
The following command will uninstall the package com.google.android.youtube
installed on the device.
$ adb uninstall com.google.android.youtube
Success
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