Copy app binary file using adb shell

Copy app binary file using adb shell

Posted by

Sometimes it is very useful to copy binary file from Android back to host OS. For example you can copy application database.

I used the following method to copy binary file out of Android in one line shell command.

This method requires app to be compiled in debug mode. You will also need to enable debug access for your mobile device.

adb -d shell 'run-as com.appname od -An -vtx1 /data/user/0/com.appname/files/file.bin' | xxd -r -p > file.bin

The above command translate files to hex stream of bytes, pipes it to shell and then turns back hex text stream back to binary.