Android: ADB install apk

In this tutorial you will learn frequently used Terminal commands (from your computer) to manage APKs on your Android device.


Search what APKs you have installed on your device

$ adb shell 'pm list packages -f' | grep /data/app/com.chicago
package:/data/app/com.chicagoandroid.cit299.week7.bookshelf-1.apk...
package:/data/app/com.chicagoandroid.cit299.naturesounds.appnaturesounds-1.apk...
package:/data/app/com.chicagoandroid.cit299.simplecamera-2.apk...

Uninstall APK by the package you found above.

$ adb uninstall com.your_package
$ adb uninstall com.chicagoandroid.cit299.week7.bookshelf

Success

Install APK 

in this example I am using created my Maven (mvn install), but you can use APK in the auto-generated build folder e.g.:

CIT299/appNatureSounds/build/outputs/apk/appNatureSounds-debug-unaligned.apk

$ adb install -r ~/.m2/repository/com/xyz.app_name/1.0-SNAPSHOT/app_name-x.y-SNAPSHOT.apk



Start the APK (you need to know the Activity name)


$ adb shell 'am start -n "com.your_package/com.your_packag.activity.YourMainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER'






As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles