I'm currently working on a BASH script to get the path of all apps through ADB in order to pull it afterwards. I get an empty line as the result of the last echo.
If I write a package name directly instead if $pkg, il works. Looks like the $pkg variable is not well "digested" by adb shell pm path
for line in $(adb shell pm list packages -3)
do
line=$line | tr -d '\r'
pkg=${line:8}
path=$(adb shell pm path $pkg | tr -d '\r')
echo $path
done
adb shell pm list packages -3and what is your action out of it?line=$(echo "$line" | tr -d '\r').