Android Backup

To backup your device, use this command. It will automatically insert the current date in the filename:

adb backup -apk -shared -all -f $(date '+%Y-%m-%d').db

If you are havong problems with the connection (“adb: unable to connect for backup”), check the listing of connected devices:

adb devices

Which may result in a listing like this:

List of devices attached 
????????????	no permissions

You can solve this by restarting the adb server:

sudo adb kill-server
sudo adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *

After this, the output of adb devices will look like this:

G65ABT632191	device

Now, try to start the backup again. Good luck!