This is an old question, but I was recently curious about this myself. I found a method that doesn't require recompiling
adbd, however it does require
su (I'm using Chainfire SuperSu 2.45).
bash is located at
su is at
/system/xbin/su, it's essentially something like this:
adb shell (use an interactive shell. Invoking this process as a
one-liner could cause ADB to cease working if there is a problem)
mount -o remount,rw /system
mv /system/bin/sh /system/bin/sh.bak
echo -e '#!/system/bin/bash\n/system/xbin/su -mm -l -s
/system/xbin/bash' > /system/bin/sh
chmod 777 /system/bin/sh
mount -o remount,ro /system
And you're done.
Simply symlinking BASH to SH doesn't work because bash emulates SH when invoked this way.
However, having a look at strace, it does seem to look for a
bashrc when a symlinked BASH is called as 'sh --login'. While this could conceivably be used to "chainload" shells via script, as mentioned above the way
adbd invokes SH is hardcoded.
If there is a problem and you have removed (or moved)
/system/bin/sh ADB wont have a shell to give you to fix the problem. When this happened to me while playing around with it, it's a matter of physically rebooting the phone (ADB is now dead) in to recovery (CWM/TWRP) which uses
adbd and SH on a partition other that system. I guess you could use a terminal emulator too if it lets you manually set the shell.