Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have aliases in adb shell non-interactive mode

Hi I need to run things in the form of adb shell <command>

When I test everything out inside adb shell, it works because I was able to set some aliases in .bashrc. However, when I do adb shell <command>, nothing works because .bashrc is not used when you run adb shell <command>, because it's in the non-interactive mode.

How can I work around this? Can I adb push some files to the filesystem so that the alias will be there when adb shell is run?

like image 488
m126531 Avatar asked Dec 20 '22 10:12

m126531


1 Answers

If your android device is rooted you can add your aliases for adb shell into the /system/etc/mkshrc file.

like image 156
Alex P. Avatar answered Jan 09 '23 08:01

Alex P.