Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you use force adb to backup without user confirmation?

Running adb backup -apk -shared -all on an Android device yields Now unlock your device and confirm the backup operation. on the Terminal and a prompt on the device screen that requires user intervention. I was hoping to automate backup and restore from adb. is there a way to force and proceed with backup without user confirmation?

like image 804
radj Avatar asked Nov 27 '22 15:11

radj


1 Answers

My solution for this case is to use dd (it's available in vanilla Android, and custom recoveries, like TWRP, as well):

sudo adb shell dd if=/dev/block/bootdevice/by-name/boot > boot.bin
sudo adb shell dd if=/dev/block/bootdevice/by-name/modem > modem.bin
sudo adb shell dd if=/dev/block/bootdevice/by-name/system > system.bin

...Or with compression:

sudo adb shell dd if=/dev/block/bootdevice/by-name/system | xz -9 -T0 - > system.bin.xz

Later the binary image can be transformed to any desired backup format.

like image 121
dess Avatar answered Dec 05 '22 20:12

dess