Showing posts from December, 2019

Install and Uninstall Android app from ADB

To Install: To install the apk from command line(after it is built successfully), adb install -t app.apk Don't forget to give the full path to the apk. To Uninstall: In short, to uninstall apk from command line type: adb uninstall package_name To be more precise: Find the exact package name by typing: adb shell su 0 pm list packages From the list, find the name of the package of your app (Say it is ) Now type: adb uninstall The app is now uninstalled from the emulator You can also find the package name by: Go to Device File Explorer in Android Studio -> data -> data -> Now scroll till you find the name of the package.

Sending Broadcast from ADB to Emulator

If you are testing an app and want to send a broadcast of an Intent from ADB, read through. To enable root access, use an emulator image like Google APIs Intel x86 Atom System Image not Google Play Intel x86 Atom System Image To test it, run  adb root . It should say restarting adbd as root or adbd is already running as root not adbd cannot run as root in production builds  Now either from a terminal app or from Terminal tab in Android Studio, type the following: adb shell su am broadcast -a android.intent.action.BOOT_COMPLETED You should get the following output: Broadcasting: Intent { act=android.intent.action.BOOT_COMPLETED } Broadcast completed: result=0