How to install android apk and uninstall or delete android application using package name using adb

If we want to install an apk already downloaded or we compiled, use below command to install the same using adb as,

 $ adb install com.android.helloworld.apk 

If we have already installed this apk previously and now want to install another version on top of this, then from adb use below command which will remove already installed application and install the new as,

 $ adb install -r com.android.helloworld.apk 

Now, if we want to uninstall the same apk, using adb, we need to know the package name of the application. Using package name, use below command.

 $ adb shell pm uninstall com.android.helloworld 

OR

 $ adb uninstall com.android.helloworld 

Now, lets say you have a development board / device and you want to know where the application/service is installed as part of system apps, and want to delete this permanantly, then use the below procedure,

 $ adb shell 
 $ su 
 $ mount -o rw,remount /system 
 $ cmd packages com.android.helloworld 

Above command will return, where this helloworld system application in installed in /system/app OR /system/priv-app

 $ rm PATH_TO_APK_AS_RETURNED_ABOVE 
Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply