Backup Apks

Get list of installed apps

adb shell pm list packages -f -3

Fetch Apks of all Installed Apps

for APP in $(adb shell pm list packages -3 -f)
do
  adb pull $( echo ${APP} | sed "s/^package://" | sed "s/base.apk=/base.apk /").apk
done

Fetch Apk of One App

adb pull /data/app/appFolderNameHere/base.apk app.apk

Getting Partitions Imgs

Backup

adb pull /dev/block/by-name/SYSTEM system.img

Restore

adb push system.img /sdcard/
Then
dd if=/sdcard/system.img of=/dev/block/by-name/SYSTEM

Logcat

adb logcat -v color