Fixed it.
@KamilCuk was correct about the issue and the general solution in their answer here, but their specific implementation didn't work for me as it created other errors (see my reply to KamilCuk's answer if curious)
As KamilCuk correctly IDed, the adb
command was accepting input continuously as a stream and was just eating the whole file as a single input while it was being looped through line by line.
The answer I got to work was to set the -n
flag in the adb shell
command which is "Don't read from stdin" in the man page. So the fix was going from the default streaming version of:
adb shell pm uninstall --user 0 "$CURRENT_LINE"
to the "Don't read from stdin" version of:
adb shell -n pm uninstall --user 0 "$CURRENT_LINE"