I use an Ubuntu Desktop Linux on my PC and a Lineage OS w/o GAPPS on my FP3.
With this environment my APK Backup is as easy as executing this command line:
for line in $(adb shell pm list packages -3 -f) ; do AppName=$(echo $line|sed ‘s/^.==/base.apk=//');AppPath=$(echo $line|sed 's/base./base.apk/’|sed ‘s/package://’) ; adb pull $AppPath ./APKs/${AppName}.apk; done
This is directly copied from my backup script and so it needs some explanation.
(you might have to recode it for a windows environment anyway)
- Get a list of all third party apps that are installed (all manually installed apps, regardles whether downloaded from anywhere, from f-droid, aurora,…)
adb shell pm list packages -3 -f
The output has one line for each app. In example, the line for my threema messenger is
package:/data/app/~~ZDzedsFANkrMJplInTeuPA==/ch.threema.app-KttNbvv7JYJ3cxLblQnMLA==/base.apk=ch.threema.app - Extract the “friendly name” of the app. This is the part at the end of the line behind “==/base.apk=”
In my example it is “ch.threema.app” I put it in the variable “AppName”. - Extract the “real path” of the app. This starts behind “package:” and ends always with “base.apk”.
In my example it is “/data/app/~~ZDzedsFANkrMJplInTeuPA==/ch.threema.app-KttNbvv7JYJ3cxLblQnMLA==/base.apk” I put it in the variable “AppPath”. - Now pull the apk.
adb pull $AppPath ./APKs/${AppName}.apk
In my example this results in
adb pull /data/app/~~ZDzedsFANkrMJplInTeuPA==/ch.threema.app-KttNbvv7JYJ3cxLblQnMLA==/base.apk ./APKs/ch.threema.app.apk
Now I have a file ch.threema.app.apk in my local subfolder “APKs”.
If you have problems recoding this to windows, you could get the list from step 1 and create a list of “adb pull” commands by hand. You would have to update the list every time, you install a new app.