Much like @CzarMatt I'd suggest saving the commands ya want run within the Android device to a shell script such as
adb_boot_animation_copy.sh on your PC...
if ! [ -f "/sdcard/bootanimation.zip" ]; then
printf 'No can do\n' >&2
su || exit "$?"
mount -o rw,remount /system
cp /sdcard/bootanimation.zip /system/media/bootanimation.zip
chmod 644 /system/media/bootanimation.zip
#!/usr/bin/env sh is more portable than
#!/bin/sh... this is not just because the Android dev. team thought it was a good idea to move things about when adopting Linux into Android, there are other unixish OSs that also got clever with where one can find an executable shell.
... then use redirection with either
adb shell "$(cat "adb_boot_animation_copy.sh")"
Which essentially does the typing of the commands saved within the
adb_boot_animation_copy.sh file for ya. Though I'm not certain that this kind of redirection will work on MS bound devices without some modifications.
Another way to redirect output of one command into the input of another...
cat adb_boot_animation_copy.sh | adb shell
Note PowerShell does have the
cat command, though ya might want to edit the file path from the above examples to be an absolute file path.
... which should result in the same behavior of redirecting commands from the
adb_boot_animation_copy.sh file into the
And yet another way would be to use the
FOR \? syntax within a
FOR /F "tokens=* USEBACKQ" %%F IN (`type adb_boot_animation_copy.sh`) DO (
... to save the continence of a file to a variable for later redirection into
adb, eg something like
adb shell "%var%", or use
type in place of
< instead of
type adb_boot_animation_copy.sh > adb shell
If ya run into issues leave a comment and perhaps I'll make another edit with more ways of doing the same thing.