Android Debug Bridge (ADB) Shell

A simple plain ADB shell command for my every day debug routine.

Check for devices:

$ adb devices

Connect to device:

a) Single device

$ adb shell

b) Multiple device

$ adb -s <device_name> shell

Pulling from remote:

$ adb -s <device_name> pull <source_file> <target_dest>

Pulling data routine:
$ adb shell
shell@hammerhead:/ $ run-as domain.com.yourapp
shell@hammerhead:/ $ cat databases/yourdatabase.db > /mnt/sdcard/data/yourdatabase.db
shell@hammerhead:/ $ exit
shell@hammerhead:/ $ exit
$ adb pull /mnt/sdcard/data/yourdatabase.db .

This will copy the db file to your computer folder.

Pushing to remote:

$ adb -s <device_name> push <source_file> <target_dest>

Note: See here for multiple push/pull.

Show Comments

Get the latest posts delivered right to your inbox.