I have a script that queries the device architecture from an android device, and uses that in a path to push a file to the device.
The code is similar to this:
ARCH=$(adb shell getprop ro.product.cpu.abi) adb push libs/"$ARCH"/binary /data/local/tmp/binary
However, the path gets mangled. When piping the
getprop command to a file, I can see that it returns a newline, which is probably the cause of the problem. I was under the impression that command substitution strips newlines, but either way, I tried:
ARCH=$(adb shell getprop ro.product.cpu.abi | tr -d '\n')
with still no luck.