ADB (Android Debug Bridge) Cheatsheet




Selecting Device

CommandDescription
adb devicesThis command is used to retrieve all devices by serial number
adb devices -lList of devices by product/model

App installation & uninstallation

CommandDescription
adb install <apk>Install app
adb shell pm install <path_from_phone>Install app from phone path
adb shell pm install -r <path_from_phone>Reinstall app from phone path
adb uninstall <com.test.package.name>Remove the app

App info

CommandDescription
adb shell pm list packagesList package names
adb shell pm list packages -fas above + path tp APks
adb shell pm -3only third party packages
adb shell pm -sonly system packages
adb shell pm -ualso uninstalled packages
adb shell dumpsys package packagesList info on all apps
adb shell pm dump nameList info on one package
adb shell pm path packagepath to the APK file

Permissions

CommandDescription
adb shell pm permission groupsPermission groups definitions
adb shell pm list permissions -g -fList permissions details

Common actions

CommandDescription
am start -a android.intent.action.VIEW -d URLTo open the URL

Miscellaneous

CommandDescription
screencap -p .pngScreenshot (saved on device)
screenrecord .mp4Screen capture (path on device)

ADB daemon

CommandDescription
adb kill-serverKill the server if it is running
adb start-serverEnsure that there is a server running
adb rootRestarts the adbd with root permissions


┬ęCopyright 2020 OneCompiler | Privacy Policy | Terms & Conditions