Tuesday, October 31, 2017

Android: How to copy apps data from a non-rooted device with adb.


Sometimes it's helpful to copy a single app data folder from a non-rooted device
Works only if "AllowBackup" flag is not set to false inside the AndroidManifest.xml




# open adb shell to device
adb shell

# get package list, grep for the right one
pm list packages

 package:com.x1622.myapp
 package:com.amazon.mShop.android.shopping
 package:com.samsung.android.provider.filterprovider
 ...

#backup this package only (follow the instructions on the device)
adb backup  -f x1622.backup com.x1622.myapp

#use abe.jar (android backup extractor) to convert to tar
java -jar abe.jar unpack x1622.backup x1622.tar <device-password>

#extract the tar file