Ilias in adb shell non-interactive mode
Hi I need to run things as adb shell <command>
When I test everything inside the adb shell it works because I was able to set some aliases in .bashrc
. However, when I do adb shell <command>
, nothing works because it is .bashrc
not used at startup adb shell <command>
because it is in non-interactive mode.
How can I get around this? Can I have adb push
some files in the filesystem so that the alias will be there when it adb shell
starts?
source to share
One way to do this is to issue multiple shell commands in a single ADB command. You can simply separate them with semicolons, like so:
adb shell "alias foo bar; export MY_VARIABLE=/path/to/somewhere; my_executable "
You can run yours .bashrc
this way, this way:
adb shell "source/path/to/.bashrc; my_executable"
source to share