Tutorial by Examples

execute the following command to insert the text into a view with a focus (if it supports text input) 6.0 Send text on SDK 23+ adb shell "input keyboard text 'Paste text on Android Device'" If already connected to your device via adb: input text 'Paste text on Android Device' 6...
Prints all packages, optionally only those whose package name contains the text in <FILTER>. adb shell pm list packages [options] <FILTER> All <FILTER> adb shell pm list packages Attributes: -f to see their associated file. -i See the installer for the packages. -u to ...
A one-liner that helps granting or revoking vulnerable permissions. granting adb shell pm grant <sample.package.id> android.permission.<PERMISSION_NAME> revoking adb shell pm revoke <sample.package.id> android.permission.<PERMISSION_NAME> Granting all run...
This command print all relevant application data: version code version name granted permissions (Android API 23+) etc.. adb shell dumpsys package <your.package.id>
4.4 Recording the display of devices running Android 4.4 (API level 19) and higher: adb shell screenrecord [options] <filename> adb shell screenrecord /sdcard/demo.mp4 (press Ctrl-C to stop recording) Download the file from the device: adb pull /sdcard/demo.mp4 Note: Stop the scre...
Notice, that in order to change file prmissions, your device need to be rooted, su binary doesn't come with factory shipped devices! Convention: adb shell su -c "chmod <numeric-permisson> <file>" Numeric permission constructed from user, group and world sections. For exa...
6.0 Default SET format is MMDDhhmm[[CC]YY][.ss], that's (2 digits each) For example, to set July 17'th 10:10am, without changing the current year, type: adb shell 'date 07171010.00' Tip 1: the date change will not be reflected immediately, and a noticable change will happen only after the syst...
adb shell am start -n com.android.settings/.DevelopmentSettings Will navigate your device/emulator to the Developer Options section.
This is relevant for apps that implement a BootListener. Test your app by killing your app and then test with: adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME -n your.app/your.app.BootListener (replace your.package/your.app.BootListener with proper ...
View content: adb shell ls \$EXTERNAL_STORAGE adb shell ls \$SECONDARY_STORAGE View path: adb shell echo \$EXTERNAL_STORAGE adb shell echo \$SECONDARY_STORAGE
Sometimes Android's logcat is running infinitely with errors coming from some process not own by you, draining battery or just making it hard to debug your code. A convenient way to fix the problem without restarting the device is to locate and kill the process causing the problem. From Logcat 03...

Page 1 of 1