for APP in $(adb shell pm list packages -3 -f | tail -n +3); do adb pull $( echo ${APP} | sed "s&^package:&&" | sed "s/=/ /" | sed 's/\r//g').apk; done
adb
is the Android CLI tool with which you can interact with your android device, from your PC
You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.