Push partition image to an Android phone
Prepare your device
- In your Android phone, enter recovery mode and enable ADB (usually, you need a custom recovery like TWRP, OrangeFox or LineageOS' recovery… etc).
- On a Linux machine, forward a local TCP port to a remote port on the Android device (let say local 6789, remote 9876).
adb forward tcp:6789 tcp:9876
adb shell
Netcat your file
Once connected to the device's shell, start netcat
in listen mode on port
9876, and redirect stdout
to the partition block device:
nc -l -p 9876 > /dev/block/sda16
Now on the Linux shell, dd
the partition backup file and redirect the output
to netcat
:
dd if=/path/to/backup.img | nc localhost 6789 &
See progress information
Using dd
, you can check for the progress using the user defined signal USR1
,
you can see the progress information by sending a USR1
signal to the dd
process (knowing it's PID
):
kill -USR1 [PID]
That's it!