Devices
List connected devices:
adb devices -l
Backup & restore
Backup your Android settings and apps:
adb backup -all -f backup.abBackup your Android settings, apps and shared storage:
adb backup -shared -all -f backup.abBackup only non-system apps:
adb backup -nosystem -all -f backup.abBackup only specific app (e.g. Kodi):
adb backup -shared -f backup_kodi.ab org.xbmc.kodiRestore a previous backup:
adb restore backup.abExtract backup:
( printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 backup.ab ) | tar -xvzf -Backup using TWRP:
adb backup --twrp
Bootloader
Reboot into the bootloader:
adb reboot bootloaderUnlock the bootloader:
fastboot oem unlockFlash recovery image ‘recovery.img’:
fastboot flash recovery recovery.imgSideload file ‘custom-rom.zip’:
adb sideload custom-rom.zip
Users
List users on the system:
adb shell pm list usersCreate a new user:
adb shell pm create-user user-nameRemove user:
adb shell pm remove-user user-nameGet maximum number of users supported:
adb shell pm get-max-users
Packages
Install an APK:
adb install path/to/file-name.apkUninstall a package:
adb uninstall package-name
Package manager
Get the list of installed packages:
adb shell pm list packagesGet the list of user installed packages:
adb shell pm list packages -3Print the path to the APK of a given package:
adb shell pm path package-nameInstall an APK:
adb shell pm install path/to/file-name.apkUninstall a package:
adb shell pm uninstall package-nameDelete data associated to a package:
adb shell pm clear package-nameEnable the given package:
adb shell pm enable package/classDisable the given package:
adb shell pm disable package/classEnable the given package for specific user:
adb shell pm enable --user 10 package/classDisable the given package for specific user:
adb shell pm disable --user 10 package/classHide the given package:
adb shell pm hide package/classUnhide the given package:
adb shell pm unhide package/class
Data
Copy a file to the device:
adb push local-path device-pathCopy a file from the device:
adb pull device-path local-pathSync device to local directory:
adb sync local-path
Debug
View device log:
adb logcatPrint information for bug reports:
adb bugreport
Misc
Record screen on device:
adb shell screenrecord /path/to/file-name.mp4
Links
- Dual Booting Android and Firefox OS on the Nexus 5
- Android SDK tools cheat sheet
- Android ADb - Epps Wiki
- Android Debug Bridge - Android Developers
- GUIDE - Full Phone Backup without Unlock or … - Samsung Galaxy Nexus - XDA Forums
- How do you extract an App’s data from a full backup made through “adb backup”? - Android Enthusiasts Stack Exchange
- Enable and disable system apps via ADB - Android Enthusiasts Stack Exchange